1(function () { 2 3 if (window.mw) { 4 console.log('%c !!! mw already defined !!! ', 'background: #009cff; color: #fff; font-size:16px;'); 5 console.log(window.mw); 6 return; 7 } 8 9 var mw = {}; 10 11 12 13 14 mw.settings = { 15 regions: false, 16 liveEdit: false, 17 debug: true, 18 basic_mode: false, 19 site_url: 'https://www.shadowsgym.com.au/cms/', 20 template_url: 'https://www.shadowsgym.com.au/cms/userfiles/templates/default/', 21 modules_url: 'https://www.shadowsgym.com.au/cms/userfiles/modules/', 22 includes_url: 'https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/', 23 upload_url: 'https://www.shadowsgym.com.au/cms/api/upload/', 24 api_url: 'https://www.shadowsgym.com.au/cms/api/', 25 libs_url: 'https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/libs/', 26 api_html: 'https://www.shadowsgym.com.au/cms/api_html/', 27 editables_created: false, 28 element_id: false, 29 text_edit_started: false, 30 sortables_created: false, 31 drag_started: false, 32 sorthandle_hover: false, 33 resize_started: false, 34 sorthandle_click: false, 35 row_id: false, 36 37 edit_area_placeholder: '<div class="empty-element-edit-area empty-element ui-state-highlight ui-sortable-placeholder"><span>Please drag items here</span></div>', 38 empty_column_placeholder: '<div id="_ID_" class="empty-element empty-element-column">Please drag items here</div>', 39 handles: { 40 item: "<div title='Click to select this item.' class='mw_master_handle' id='items_handle'></div>" 41 }, 42 sorthandle_delete_confirmation_text: "Are you sure you want to delete this element?" 43 } 44 45 mw.settings.libs = { 46 jqueryui: [ 47 function () { 48 mw.require(mw.settings.libs_url + 'jqueryui' + '/jquery-ui.min.js'); 49 mw.require(mw.settings.libs_url + 'jqueryui' + '/jquery-ui.min.css'); 50 } 51 ], 52 morris: ['morris.css', 'raphael.js', 'morris.js'], 53 rangy: ['rangy-core.js', 'rangy-cssclassapplier.js', 'rangy-selectionsaverestore.js', 'rangy-serializer.js'], 54 highlight: [ 55 56 'highlight.min.js', 57 'highlight.min.css' 58 59 ], 60 bootstrap2: [ 61 function () { 62 var v = document.querySelector('meta[name="viewport"]'); 63 if (v === null) { 64 v = document.createElement('meta'); 65 v.name = "viewport"; 66 } 67 v.content = "width=device-width, initial-scale=1.0"; 68 mwhead.appendChild(v); 69 }, 70 'css/bootstrap.min.css', 71 'css/bootstrap-responsive.min.css', 72 'js/bootstrap.min.js' 73 ], 74 bootstrap3: [ 75 function () { 76 mw.require(mw.settings.libs_url + 'fontawesome-4.7.0' + '/css/font-awesome.min.css'); 77 var v = document.querySelector('meta[name="viewport"]'); 78 if (v === null) { 79 v = document.createElement('meta'); 80 v.name = "viewport"; 81 } 82 v.content = "width=device-width, initial-scale=1.0"; 83 mwhead.appendChild(v); 84 }, 85 'css/bootstrap.min.css', 86 'js/bootstrap.min.js' 87 ], 88 bootstrap4: [ 89 function () { 90 mw.require(mw.settings.libs_url + 'bootstrap-4.3.1' + '/css/bootstrap.min.css'); 91 mw.require(mw.settings.libs_url + 'bootstrap-4.3.1' + '/js/popper.min.js'); 92 mw.require(mw.settings.libs_url + 'bootstrap-4.3.1' + '/js/bootstrap.min.js'); 93 mw.require(mw.settings.libs_url + 'fontawesome-free-5.12.0' + '/css/all.min.css'); 94 } 95 ], 96 97 bootstrap5js: [ 98 function () { 99 mw.require(mw.settings.libs_url + 'bootstrap5' + '/js/bootstrap.bundle.min.js'); 100 } 101 ], 102 bootstrap5: [ 103 function () { 104 mw.require(mw.settings.libs_url + 'bootstrap5' + '/css/bootstrap.' + (document.documentElement.dir==='rtl' ? 'rtl.' : '') + 'min.css'); 105 mw.lib.require('bootstrap5js') 106 } 107 ], 108 microweber_ui: [ 109 function () { 110 mw.require(mw.settings.libs_url + 'mw-ui' + '/grunt/plugins/ui/css/main.css'); 111 mw.require(mw.settings.libs_url + 'mw-ui' + '/assets/ui/plugins/css/plugins.min.css'); 112 mw.require(mw.settings.libs_url + 'mw-ui' + '/assets/ui/plugins/js/plugins.js'); 113 } 114 115 116 ], 117 mwui: [ 118 function () { 119 // mw.require(mw.settings.libs_url + 'mw-ui' + '/grunt/plugins/ui/css/main.css'); 120 // mw.require(mw.settings.libs_url + 'mw-ui' + '/assets/ui/plugins/css/plugins.min.css'); 121 // mw.require(mw.settings.libs_url + 'mw-ui' + '/grunt/plugins/ui/css/mw.css'); 122 //The files above are added in default.css 123 mw.require(mw.settings.libs_url + 'mw-ui' + '/assets/ui/plugins/js/plugins.js'); 124 } 125 126 127 ], 128 mwui_init: [ 129 function () { 130 mw.require(mw.settings.libs_url + 'mw-ui' + '/grunt/plugins/ui/js/ui.js'); 131 } 132 ], 133 flag_icons: [ 134 function () { 135 mw.require(mw.settings.libs_url + 'flag-icon-css' + '/css/flag-icon.min.css'); 136 137 } 138 ], 139 font_awesome: [ 140 function () { 141 mw.require(mw.settings.libs_url + 'fontawesome-4.7.0' + '/css/font-awesome.min.css'); 142 143 } 144 ], 145 font_awesome5: [ 146 function () { 147 mw.require(mw.settings.libs_url + 'fontawesome-free-5.12.0' + '/css/all.min.css'); 148 149 } 150 ],
151 bxslider: [ 152 function () { 153 mw.require(mw.settings.libs_url + 'bxSlider/jquery.bxslider.min.js', true); 154 mw.require(mw.settings.libs_url + 'bxSlider/jquery.bxslider.css', true); 155 156 } 157 ], 158 collapse_nav: [ 159 function () { 160 mw.require(mw.settings.libs_url + 'collapse-nav/dist/collapseNav.js', true); 161 mw.require(mw.settings.libs_url + 'collapse-nav/dist/collapseNav.css', true); 162 163 } 164 ], 165 slick: [ 166 function () { 167 mw.require(mw.settings.libs_url + 'slick/slick.css', true); 168 mw.moduleCSS(mw.settings.libs_url + 'slick/slick-theme.css'); 169 mw.require(mw.settings.libs_url + 'slick/slick.min.js', true); 170 } 171 ], 172 ion_range_slider: [ 173 function () { 174 mw.require(mw.settings.libs_url + 'ion-range-slider' + '/css/ion.rangeSlider.min.css', true); 175 mw.require(mw.settings.libs_url + 'ion-range-slider' + '/js/ion.rangeSlider.min.js', true); 176 } 177 ], 178 air_datepicker: [ 179 function () { 180 181 mw.require(mw.settings.libs_url + 'air-datepicker' + '/css/datepicker.min.css', true); 182 mw.require(mw.settings.libs_url + 'air-datepicker' + '/js/datepicker.min.js', true); 183 184 $.fn.datepicker.language['en'] = { 185 days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 186 daysMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 187 daysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 188 months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 189 monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 190 today: 'Today', 191 clear: 'Clear', 192 dateFormat: 'yyyy-mm-dd', 193 firstDay: 0 194 }; 195 196 } 197 ], 198 bootstrap_datepicker: [ 199 function () { 200 mw.require(mw.settings.libs_url + 'bootstrap-datepicker' + '/css/bootstrap-datepicker3.css', true); 201 mw.require(mw.settings.libs_url + 'bootstrap-datepicker' + '/js/bootstrap-datepicker.js', true); 202 } 203 ], 204 bootstrap_datetimepicker: [ 205 function () { 206 mw.require(mw.settings.libs_url + 'bootstrap-datetimepicker' + '/css/bootstrap-datetimepicker.min.css', true); 207 mw.require(mw.settings.libs_url + 'bootstrap-datetimepicker' + '/js/bootstrap-datetimepicker.min.js', true); 208 } 209 ], 210 bootstrap3ns: [ 211 function () { 212 213 //var bootstrap_enabled = (typeof $().modal == 'function'); 214 var bootstrap_enabled = (typeof $ != 'undefined' && typeof $.fn != 'undefined' && typeof $.fn.emulateTransitionEnd != 'undefined'); 215 216 if (!bootstrap_enabled) { 217 mw.require(mw.settings.libs_url + 'bootstrap3' + '/js/bootstrap.min.js'); 218 //var bootstrap_enabled = (typeof $().modal == 'function'); 219 //if (bootstrap_enabled == false) { 220 mw.require(mw.settings.libs_url + 'bootstrap3ns' + '/bootstrap.min.css'); 221 mw.require(mw.settings.libs_url + 'fontawesome-4.7.0' + '/css/font-awesome.min.css'); 222 } 223 // } 224 } 225 ], 226 bootstrap_select: [ 227 function () { 228 //var bootstrap_enabled = (typeof $().modal == 'function'); 229 //if (!bootstrap_enabled == false) { 230 mw.require(mw.settings.libs_url + 'bootstrap-select-1.13.12' + '/js/bootstrap-select.min.js'); 231 mw.require(mw.settings.libs_url + 'bootstrap-select-1.13.12' + '/css/bootstrap-select.min.css'); 232 //} 233 } 234 ], 235 bootstrap_tags: [ 236 function () { 237 238 // var bootstrap_enabled = (typeof $().modal == 'function'); 239 //if (!bootstrap_enabled == false) { 240 mw.require(mw.settings.libs_url + 'typeahead' + '/typeahead.jquery.js'); 241 mw.require(mw.settings.libs_url + 'typeahead' + '/typeahead.bundle.min.js'); 242 mw.require(mw.settings.libs_url + 'typeahead' + '/bloodhound.js'); 243 mw.require(mw.settings.libs_url + 'mw-ui/grunt/plugins/tags' + '/bootstrap-tagsinput.css'); 244 mw.require(mw.settings.libs_url + 'mw-ui/grunt/plugins/tags' + '/bootstrap-tagsinput.js'); 245 //} else { 246 //mw.log("You must load bootstrap to use bootstrap_tags"); 247 //} 248 249 } 250 ], 251 chosen: [ 252 function () { 253 mw.require(mw.settings.libs_url + 'chosen' + '/chosen.jquery.min.js'); 254 mw.require(mw.settings.libs_url + 'chosen' + '/chosen.min.css', true); 255 } 256 ], 257 validation: [ 258 function () { 259 mw.require(mw.settings.libs_url + 'jquery_validation' + '/js/jquery.validationEngine.js'); 260 mw.require(mw.settings.libs_url + 'jquery_validation' + '/js/languages/jquery.validationEngine-en.js'); 261 mw.require(mw.settings.libs_url + 'jquery_validation' + '/css/validationEngine.jquery.css'); 262 } 263 ], 264
265 fitty: [ 266 function () { 267 mw.require(mw.settings.libs_url + 'fitty' + '/dist/fitty.min.js'); 268 /*$(document).ready(function () { 269 fitty('.fitty-element'); 270 });*/ 271 } 272 ], 273 274 275 typed: [ 276 function () { 277 mw.require(mw.settings.libs_url + "typed/typed.umd.js") 278 } 279 ], 280 281 swiper: [ 282 function () { 283 mw.require(mw.settings.libs_url + "swiper/swiper-bundle.min.css"); 284 mw.require(mw.settings.libs_url + "swiper/swiper-bundle.min.js"); 285 } 286 ], 287 288 jseldom: [ 289 function () { 290 mw.require(mw.settings.libs_url + "jseldom/jseldom.js"); 291 } 292 ], 293 294 295 flatstrap3: [ 296 function () { 297 var v = document.querySelector('meta[name="viewport"]'); 298 if (v === null) { 299 v = document.createElement('meta'); 300 v.name = "viewport"; 301 } 302 v.content = "width=device-width, initial-scale=1.0"; 303 mwhead.appendChild(v); 304 }, 305 'css/bootstrap.min.css', 306 'js/bootstrap.min.js' 307 ], 308 datepicker: [ 309 'datepicker.min.js', 310 'datepicker.min.css' 311 ], 312 datetimepicker: [ 313 'jquery.datetimepicker.full.min.js', 314 'jquery.datetimepicker.min.css' 315 ], 316 317 nestedSortable: [ 318 function () { 319 mw.require(mw.settings.libs_url + 'nestedsortable' + '/jquery.mjs.nestedSortable.js'); 320 } 321 ], 322 colorpicker: [ 323 function () { 324 mw.require(mw.settings.includes_url + 'api' + '/color.js'); 325 mw.require(mw.settings.libs_url + 'acolorpicker' + '/acolorpicker.js'); 326 } 327 ], 328 material_icons: [ 329 function () { 330 mw.require(mw.settings.libs_url + 'material_icons' + '/material_icons.css'); 331 } 332 ], 333 materialDesignIcons: [ 334 function () { 335 mw.require(mw.settings.modules_url + 'microweber/css/fonts/materialdesignicons/css/materialdesignicons.min.css'); 336 } 337 ], 338 mw_icons_mind: [ 339 function () { 340 mw.require(mw.settings.modules_url + 'microweber/css/fonts/mw-icons-mind/line/style.css'); 341 mw.require(mw.settings.modules_url + 'microweber/css/fonts/mw-icons-mind/solid/style.css'); 342 } 343 ], 344 uppy: [ 345 'uppy.min.js', 346 'uppy.min.css' 347 ], 348 apexcharts: [ 349 'apexcharts.min.js', 350 'apexcharts.css' 351 ] , 352 easymde: [ 353 function () { 354 mw.require(mw.settings.libs_url + 'easymde' + '/easymde.min.js', true); 355 mw.require(mw.settings.libs_url + 'easymde' + '/easymde.min.css', true); 356 } 357 ], 358 anchorific: [ 359 function () { 360 mw.require(mw.settings.libs_url + 'anchorific' + '/anchorific.min.js', true); 361 } 362 ], 363 multilanguage: [ 364 function () { 365 mw.require(mw.settings.libs_url + 'multilanguage' + '/mlInput.js'); 366 mw.require(mw.settings.libs_url + 'multilanguage' + '/mlTextArea.js'); 367 } 368 ], 369 370 nouislider: [ 371 function () { 372 // mw.require(mw.settings.libs_url + 'nouislider' + '/nouislider.css'); 373 mw.require(mw.settings.libs_url + 'nouislider' + '/nouislider.js'); 374 } 375 ], 376 377 noUIiSliderStyled: [ 378 function () { 379 mw.require(mw.settings.libs_url + 'nouislider' + '/nouislider.css'); 380 mw.require(mw.settings.libs_url + 'nouislider' + '/nouislider.js'); 381 } 382 ], 383 384 tinymce: [ 385 function () { 386 mw.require(mw.settings.libs_url + 'tinymce' + '/tinymce.min.js'); 387 } 388 ], 389 390 gsap: [ 391 function () { 392 mw.require(mw.settings.libs_url + 'gsap' + '/gsap-umd.js'); 393 } 394 ], 395 396 xss: [ 397 function () { 398 mw.require(mw.settings.libs_url + "xss/xss.min.js"); 399 } 400 ], 401 402 403 codemirror: [ 404 function () { 405 mw.require(mw.settings.libs_url + 'codemirror' + '/codemirror.min.js'); 406 mw.require(mw.settings.libs_url + 'codemirror' + '/css.min.js'); 407 mw.require(mw.settings.libs_url + 'codemirror' + '/xml.js'); 408 mw.require(mw.settings.libs_url + 'codemirror' + '/javascript.js'); 409 mw.require(mw.settings.libs_url + 'codemirror' + '/css.js'); 410 mw.require(mw.settings.libs_url + 'codemirror' + '/csslint.js'); 411 mw.require(mw.settings.libs_url + 'codemirror' + '/css-lint-plugin.js'); 412 mw.require(mw.settings.libs_url + 'codemirror' + '/htmlmixed.min.js'); 413 mw.require(mw.settings.libs_url + 'codemirror' + '/php.min.js'); 414 mw.require(mw.settings.libs_url + 'codemirror' + '/autorefresh.js'); 415 mw.require(mw.settings.libs_url + 'codemirror' + '/selection-
415pointer.js'); 416 mw.require(mw.settings.libs_url + 'codemirror' + '/xml-fold.js'); 417 mw.require(mw.settings.libs_url + 'codemirror' + '/matchtags.js'); 418 mw.require(mw.settings.libs_url + 'codemirror' + '/beautify.min.js'); 419 mw.require(mw.settings.libs_url + 'codemirror' + '/beautify-css.min.js'); 420 mw.require(mw.settings.libs_url + 'codemirror' + '/beautify-html.min.js'); 421 mw.require(mw.settings.libs_url + 'codemirror' + '/style.css'); 422 } 423 424 ], 425 masonry: [ 426 function () { 427 mw.require(mw.settings.libs_url + 'masonry' + '/masonry.js'); 428 } 429 ] 430 }; 431 432 mw.lib = { 433 _required: [], 434 require: function (name) { 435 if (mw.lib._required.indexOf(name) !== -1) { 436 return false; 437 } 438 mw.lib._required.push(name); 439 if (typeof mw.settings.libs[name] === 'undefined') return false; 440 if (mw.settings.libs[name].constructor !== [].constructor) return false; 441 var path = mw.settings.libs_url + name + '/', 442 arr = mw.settings.libs[name], 443 l = arr.length, 444 i = 0, 445 c = 0; 446 for (; i < l; i++) { 447 (typeof arr[i] === 'string') ? mw.require(path + arr[i], true) : (typeof arr[i] === 'function') ? arr[i].call() : ''; 448 } 449 }, 450 }; 451 452 mw.lang = function (key) { 453 var camel = key.trim().replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) { 454 return index == 0 ? letter.toLowerCase() : letter.toUpperCase(); 455 }).replace(/\s+/g, ''); 456 if (mw._lang[camel]) { 457 return mw._lang[camel]; 458 } 459 else { 460 // console.warn('"' + key + '" is not present.'); 461 return key; 462 } 463 }; 464 mw.msg = mw._lang = { 465 uniqueVisitors: 'Unique visitors', 466 allViews: 'All views', 467 date: 'Date', 468 weekDays: { 469 regular: [ 470 'Sunday', 471 'Monday', 472 'Tuesday', 473 'Wednesday', 474 'Thursday', 475 'Friday', 476 'Saturday' 477 ], 478 short: [ 479 'Sun', 480 'Mon', 481 'Tue', 482 'Wed', 483 'Thu', 484 'Fri', 485 'Sat' 486 ] 487 }, 488 months: { 489 regular: [ 490 'January', 491 'February', 492 'March', 493 'April', 494 'May', 495 'June', 496 'July', 497 'August', 498 'September', 499 'October', 500 'November', 501 'December' 502 ], 503 short: [ 504 'Jan', 505 'Feb', 506 'Mar', 507 'Apr', 508 'May', 509 'June', 510 'July', 511 'Aug', 512 'Sept', 513 'Oct', 514 'Nov', 515 'Dec' 516 ] 517 }, 518 ok: "OK", 519 category: "Category", 520 published: "Published", 521 unpublished: "Unpublished", 522 contentunpublished: "Content is unpublished", 523 contentpublished: "Content is published", 524 save: "Save", 525 saving: "Saving", 526 saved: "Saved", 527 settings: "Settings", 528 cancel: "Cancel", 529 remove: "Remove", 530 close: "Close", 531 to_delete_comment: "Are you sure you want to delete this comment", 532 del: "Are you sure you want to delete this?", 533 save_and_continue: "Save &amp; Continue", 534 before_leave: "Leave without saving", 535 session_expired: "Your session has expired", 536 login_to_continue: "Please login to continue", 537 more: "More", 538 templateSettingsHidden: "Template settings", 539 less: "Less", 540 product_added: "Your product is added to cart", 541 no_results_for: "No results for", 542 switch_to_modules: 'Switch to Modules', 543 switch_to_layouts: 'Switch to Layouts', 544 loading: 'Loading', 545 edit: 'Edit', 546 change: 'Change', 547 submit: 'Submit', 548 settingsSaved: 'Settings are saved', 549 addImage: 'Add new image' 550 }; 551 552 553 if (!window.mw) { 554 window.mw = mw; 555 } 556})(); 557 558 559 const Ziggy = {"url":"https:\/\/www.shadowsgym.com.au\/cms","port":null,"defaults":{},"routes":{"live_edit.module_settings":{"uri":"api\/live_edit\/live_edit.module_settings","methods":["GET","HEAD"]},"logout":{"uri":"logout","methods":["GET","HEAD"]},"logout.submit":{"uri":"logout","methods":["POST"]},"verification.verify":{"uri":"email\/verify\/{id}\/{hash}","methods":["GET","HEAD"]},"verification.resend":{"uri":"email\/verify-resend\/{id}\/{hash}","methods":["GET","HEAD"]},"verification.send":{"uri":"email\/verify-resend\/{id}\/{hash}","methods":["POST"]},"password.request":{"uri":"forgot-password","methods":["GET","HEAD"]},"password.email":{"uri":"forgot-password","methods":["POST"]},"password.reset":{"uri":"reset-password\/{token}","methods":["GET","HEAD"]},"password.update":{"uri":"reset-password","methods":["POST"]},"current_template_save_custom_css":{"uri":"api\/current_template_save_custom_css","methods":["POST"]},"template_remove_custom_css":{"uri":"api\/layouts\/template_remove_custom_css","methods":["POST"]},"delete_compiled_css":{"uri":"api\/template\/delete_compiled_css","methods":["GET","HEAD"]},"template_compile_css":{"uri":"api\/template\/compile_css","methods":["GET","HEAD"]},"standalone-updater.about-new-version":{"uri":"myniltpytxdrfywb\/standalone-updater\/about-new-version","methods":["GET","HEAD"]},"web.newsletter.unsubscribe":{"uri":"web\/modules\/newsletter\/unsub
559scribe","methods":["GET","HEAD"]},"livewire.message":{"uri":"livewire\/message\/{name}","methods":["POST"]},"livewire.upload-file":{"uri":"livewire\/upload-file","methods":["POST"]},"livewire.preview-file":{"uri":"livewire\/preview-file\/{filename}","methods":["GET","HEAD"]},"login":{"uri":"login","methods":["GET","HEAD"]},"two-factor.login":{"uri":"two-factor-challenge","methods":["GET","HEAD"]},"two-factor.enable":{"uri":"user\/two-factor-authentication","methods":["POST"]},"two-factor.disable":{"uri":"user\/two-factor-authentication","methods":["DELETE"]},"two-factor.qr-code":{"uri":"user\/two-factor-qr-code","methods":["GET","HEAD"]},"two-factor.recovery-codes":{"uri":"user\/two-factor-recovery-codes","methods":["GET","HEAD"]},"checkout.cart":{"uri":"checkout\/cart","methods":["GET","HEAD"]},"checkout.contact_information":{"uri":"checkout\/contact-information","methods":["GET","HEAD"]},"checkout.contact_information_save":{"uri":"checkout\/contact-information-save","methods":["POST"]},"checkout.shipping_method":{"uri":"checkout\/shipping-method","methods":["GET","HEAD"]},"checkout.shipping_method_change":{"uri":"checkout\/shipping-method-change","methods":["POST"]},"checkout.shipping_method_save":{"uri":"checkout\/shipping-method-save","methods":["POST"]},"checkout.payment_method":{"uri":"checkout\/payment-method","methods":["GET","HEAD"]},"checkout.payment_method_change":{"uri":"checkout\/payment-method-change","methods":["POST"]},"checkout.payment_method_save":{"uri":"checkout\/payment-method-save","methods":["POST"]},"checkout.login":{"uri":"checkout\/login","methods":["GET","HEAD"]},"checkout.forgot_password":{"uri":"checkout\/forgot-password","methods":["GET","HEAD"]},"checkout.register":{"uri":"checkout\/register","methods":["GET","HEAD"]},"checkout.finish":{"uri":"checkout\/finish\/{id}","methods":["GET","HEAD"]},"shop.shipping.set_provider":{"uri":"api\/shop\/shipping\/set_provider","methods":["GET","POST","HEAD"]},"debugbar.openhandler":{"uri":"_debugbar\/open","methods":["GET","HEAD"]},"debugbar.clockwork":{"uri":"_debugbar\/clockwork\/{id}","methods":["GET","HEAD"]},"debugbar.assets.css":{"uri":"_debugbar\/assets\/stylesheets","methods":["GET","HEAD"]},"debugbar.assets.js":{"uri":"_debugbar\/assets\/javascript","methods":["GET","HEAD"]},"debugbar.cache.delete":{"uri":"_debugbar\/cache\/{key}\/{tags?}","methods":["DELETE"]},"adminadmin.index":{"uri":"myniltpytxdrfywb","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"editor_tools":{"uri":"editor_tools\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"adminadmin.all":{"uri":"myniltpytxdrfywb\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"apijs":{"uri":"apijs\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"set_app_lang":{"uri":"api\/set_app_lang","methods":["GET","HEAD"]},"csrf-validate-token":{"uri":"csrf-validate-token","methods":["POST"]},"csrf":{"uri":"csrf","methods":["POST"]},"module":{"uri":"module\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"api":{"uri":"api\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"api_html":{"uri":"api_html\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"apiapi_nosession.all":{"uri":"api_nosession\/{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"api_nosession":{"uri":"api_nosession","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"home":{"uri":"\/","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"robots":{"uri":"robots.txt","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"ads-txt":{"uri":"ads.txt","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"sitemap.index":{"uri":"sitemap.xml","methods":["GET","HEAD"]},"sitemap.categories":{"uri":"sitemap.xml\/categories","methods":["GET","HEAD"]},"sitemap.tags":{"uri":"sitemap.xml\/tags","methods":["GET","HEAD"]},"sitemap.products":{"uri":"sitemap.xml\/products","methods":["GET","HEAD"]},"sitemap.posts":{"uri":"sitemap.xml\/posts","methods":["GET","HEAD"]},"sitemap.pages":{"uri":"sitemap.xml\/pages","methods":["GET","HEAD"]},"rss.index":{"uri":"rss","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"rss.products":{"uri":"rss-products","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"rss.posts":{"uri":"rss-posts","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},"all":{"uri":"{all}","methods":["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"],"wheres":{"all":".*"}},"passport.token":{"uri":"oauth\/token","methods":["POST"]},"passport.authorizations.authorize":{"uri":"oauth\/authorize","methods":["GET","HEAD"]},"passport.token.refresh":{"uri":"oauth\/token\/refresh","methods":["POST"]},"passport.authorizations.approve":{"uri":"oauth\/authorize","methods":["POST"]},"passport.authorizations.deny":{"uri":"oauth\/authorize","methods":["DELETE"]},"passport.tokens.index":{"uri":"oauth\/tokens","methods":["GET","HEAD"]},"passport.tokens.destroy":{"uri":"oauth\/tokens\/{token_id}","methods":["DELETE"]},"passport.clients.index":{"uri":"oauth\/clients","methods":["GET","HEAD"]},"passport.clients.store":{"uri":"oauth\/clients","methods":["POST"]},"passport.clients.update":{"uri":"oauth\/clients\/{client_id}","methods":["PUT"]},"passport.clients.destroy":{"uri":"oauth\/clients\/{client_id}","methods":["DELETE"]},"passport.scopes.index":{"uri":"oauth\/scopes","methods":["GET","HEAD"]},"passport.personal.tokens.index":{"uri":"oauth\/personal-access-tokens","methods":["GET","HEAD"]},"passport.personal.tokens.store":{"uri":"oauth\/personal-access-tokens","methods":["POST"]},"passport.personal.tokens.destroy":{"uri":"oauth\/personal-access-tokens\/{token_id}","methods":["DELETE"]},"sanctum.csrf-cookie":{"uri":"sanctum\/csrf-cookie","methods":["GET","HEAD"]}}}; 560 561 !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t||self).route=r()}(this,function(){function t(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,"symbol"==typeof(o=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key))?o:String(o),n)}var o}function r(r,e,n){return e&&t(r.prototype,e),n&&t(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},e.apply(this,arguments)}
vendor: 7,003 bytes, line 561
561function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function o(t,r){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},o(t,r)}function i(t,r,e){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,r,e){var n=[null];n.push.apply(n,r);var i=new(Function.bind.apply(t,n));return e&&o(i,e.prototype),i},i.apply(null,arguments)}function u(t){var r="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return i(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},u(t)}var f=String.prototype.replace,a=/%20/g,c="RFC3986",l={default:c,formatters:{RFC1738:function(t){return f.call(t,a,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:c},s=Object.prototype.hasOwnProperty,v=Array.isArray,p=function(){for(var t=[],r=0;r<256;++r)t.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return t}(),y=function(t,r){for(var e=r&&r.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(e[n]=t[n]);return e},d={arrayToObject:y,assign:function(t,r){return Object.keys(r).reduce(function(t,e){return t[e]=r[e],t},t)},combine:function(t,r){return[].concat(t,r)},compact:function(t){for(var r=[{obj:{o:t},prop:"o"}],e=[],n=0;n<r.length;++n)for(var o=r[n],i=o.obj[o.prop],u=Object.keys(i),f=0;f<u.length;++f){var a=u[f],c=i[a];"object"==typeof c&&null!==c&&-1===e.indexOf(c)&&(r.push({obj:i,prop:a}),e.push(c))}return function(t){for(;t.length>1;){var r=t.pop(),e=r.obj[r.prop];if(v(e)){for(var n=[],o=0;o<e.length;++o)void 0!==e[o]&&n.push(e[o]);r.obj[r.prop]=n}}}(r),t},decode:function(t,r,e){var n=t.replace(/\+/g," ");if("iso-8859-1"===e)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,r,e,n,o){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===e)return escape(i).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var u="",f=0;f<i.length;++f){var a=i.charCodeAt(f);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===l.RFC1738&&(40===a||41===a)?u+=i.charAt(f):a<128?u+=p[a]:a<2048?u+=p[192|a>>6]+p[128|63&a]:a<55296||a>=57344?u+=p[224|a>>12]+p[128|a>>6&63]+p[128|63&a]:(a=65536+((1023&a)<<10|1023&i.charCodeAt(f+=1)),u+=p[240|a>>18]+p[128|a>>12&63]+p[128|a>>6&63]+p[128|63&a])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(v(t)){for(var e=[],n=0;n<t.length;n+=1)e.push(r(t[n]));return e}return r(t)},merge:function t(r,e,n){if(!e)return r;if("object"!=typeof e){if(v(r))r.push(e);else{if(!r||"object"!=typeof r)return[r,e];(n&&(n.plainObjects||n.allowPrototypes)||!s.call(Object.prototype,e))&&(r[e]=!0)}return r}if(!r||"object"!=typeof r)return[r].concat(e);var o=r;return v(r)&&!v(e)&&(o=y(r,n)),v(r)&&v(e)?(e.forEach(function(e,o){if(s.call(r,o)){var i=r[o];i&&"object"==typeof i&&e&&"object"==typeof e?r[o]=t(i,e,n):r.push(e)}else r[o]=e}),r):Object.keys(e).reduce(function(r,o){var i=e[o];return r[o]=s.call(r,o)?t(r[o],i,n):i,r},o)}},b=Object.prototype.hasOwnProperty,h={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},m=Array.isArray,g=String.prototype.split,j=Array.prototype.push,w=function(t,r){j.apply(t,m(r)?r:[r])},O=Date.prototype.toISOString,E=l.default,R={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:d.encode,encodeValuesOnly:!1,format:E,formatter:l.formatters[E],indices:!1,serializeDate:function(t){return O.call(t)},skipNulls:!1,strictNullHandling:!1},S=function t(r,e,n,o,i,u,f,a,c,l,s,v,p,y){var b,h=r;if("function"==typeof f?h=f(e,h):h instanceof Date?h=l(h):"comma"===n&&m(h)&&(h=d.maybeMap(h,function(t){return t instanceof Date?l(t):t})),null===h){if(o)return u&&!p?u(e,R.encoder,y,"key",s):e;h=""}if("string"==typeof(b=h)||"number"==typeof b||"boolean"==typeof b||"symbol"==typeof b||"bigint"==typeof b||d.isBuffer(h)){if(u){var j=p?e:u(e,R.encoder,y,"key",s);if("comma"===n&&p){for(var O=g.call(String(h),","),E="",S=0;S<O.length;++S)E+=(0===S?"":",")+v(u(O[S],R.encoder,y,"value",s));return[v(j)+"="+E]}return[v(j)+"="+v(u(h,R.encoder,y,"value",s))]}return[v(e)+"="+v(String(h))]}var T,k=[];if(void 0===h)return k;if("comma"===n&&m(h))T=[{value:h.length>0?h.join(",")||null:void 0}];else if(m(f))T=f;else{var x=Object.keys(h);T=a?x.sort(a):x}for(var C=0;C<T.length;++C){var N=T[C],D="object"==typeof N&&void 0!==N.value?N.value:h[N];if(!i||null!==D){var F=m(h)?"function"==typeof n?n(e,N):e:e+(c?"."+N:"["+N+"]");w(k,t(D,F,n,o,i,u,f,a,c,l,s,v,p,y))}}return k},T=Object.prototype.hasOwnProperty,k=Array.isArray,x={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:d.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},C=function(t){return t.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},N=function(t,r){return t&&"string"==typeof t&&r.comma&&t.indexOf(",")>-1?t.split(","):t},D=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!e.plainObjects&&T.call(Object.prototype,f)&&!e.allowPrototypes)return;a.push(f)}for(var c=0;e.depth>0&&null!==(u=i.exec(o))&&c<e.depth;){if(c+=1,!e.plainObjects&&T.call(Object.prototype,u[1].slice(1,-1))&&!e.allowPrototypes)return;a.push(u[1])}return u&&a.push("["+o.slice(u.index)+"]"),function(t,r,e,n){for(var o=n?r:N(r,e),i=t.length-1;i>=0;--i){var u,f=t[i];if("[]"===f&&e.parseArrays)u=[].concat(o);else{u=e.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,c=parseInt(a,10);e.parseArrays||""!==a?!isNaN(c)&&f!==a&&String(c)===a&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(u=[])[c]=o:"__proto__"!==a&&(u[a]=o):u={0:o}}o=u}return o}(a,r,e,n)}},F=function(t,r){var e=function(t){if(!t)return x;if(null!=t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");
561if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");return{allowDots:void 0===t.allowDots?x.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:x.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:x.arrayLimit,charset:void 0===t.charset?x.charset:t.charset,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:x.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:x.comma,decoder:"function"==typeof t.decoder?t.decoder:x.decoder,delimiter:"string"==typeof t.delimiter||d.isRegExp(t.delimiter)?t.delimiter:x.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:x.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:x.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:x.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:x.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:x.strictNullHandling}}(r);if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e<o.length;++e)0===o[e].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[e]?u="utf-8":"utf8=%26%2310003%3B"===o[e]&&(u="iso-8859-1"),i=e,e=o.length);for(e=0;e<o.length;++e)if(e!==i){var f,a,c=o[e],l=c.indexOf("]="),s=-1===l?c.indexOf("="):l+1;-1===s?(f=r.decoder(c,x.decoder,u,"key"),a=r.strictNullHandling?null:""):(f=r.decoder(c.slice(0,s),x.decoder,u,"key"),a=d.maybeMap(N(c.slice(s+1),r),function(t){return r.decoder(t,x.decoder,u,"value")})),a&&r.interpretNumericEntities&&"iso-8859-1"===u&&(a=C(a)),c.indexOf("[]=")>-1&&(a=k(a)?[a]:a),n[f]=T.call(n,f)?d.combine(n[f],a):a}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),u=0;u<i.length;++u){var f=i[u],a=D(f,n[f],e,"string"==typeof t);o=d.merge(o,a,e)}return d.compact(o)},P=/*#__PURE__*/function(){function t(t,r,e){var n,o;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.wheres=null!=(o=r.wheres)?o:{},this.config=e}var e=t.prototype;return e.matchesUrl=function(t){var r=this;if(!this.definition.methods.includes("GET"))return!1;var e=this.template.replace(/(\/?){([^}?]*)(\??)}/g,function(t,e,n,o){var i,u="(?<"+n+">"+((null==(i=r.wheres[n])?void 0:i.replace(/(^\^)|(\$$)/g,""))||"[^/?]+")+")";return o?"("+e+u+")?":""+e+u}).replace(/^\w+:\/\//,""),n=t.replace(/^\w+:\/\//,"").split("?"),o=n[0],i=n[1],u=new RegExp("^"+e+"/?$").exec(o);if(u){for(var f in u.groups)u.groups[f]="string"==typeof u.groups[f]?decodeURIComponent(u.groups[f]):u.groups[f];return{params:u.groups,query:F(i)}}return!1},e.compile=function(t){var r=this,e=this.parameterSegments;return e.length?this.template.replace(/{([^}?]+)(\??)}/g,function(n,o,i){var u;if(!i&&[null,void 0].includes(t[o]))throw new Error("Ziggy error: '"+o+"' parameter is required for route '"+r.name+"'.");if(r.wheres[o]){var f,a;if(!new RegExp("^"+(i?"("+r.wheres[o]+")?":r.wheres[o])+"$").test(null!=(f=t[o])?f:""))throw new Error("Ziggy error: '"+o+"' parameter does not match required format '"+r.wheres[o]+"' for route '"+r.name+"'.");if(e[e.length-1].name===o)return encodeURIComponent(null!=(a=t[o])?a:"").replace(/%2F/g,"/")}return encodeURIComponent(null!=(u=t[o])?u:"")}).replace(this.origin+"//",this.origin+"/").replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return(this.origin+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"origin",get:function(){return this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:""}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),$=/*#__PURE__*/function(t){var n,i;function u(r,n,o,i){var u;if(void 0===o&&(o=!0),(u=t.call(this)||this).t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=e({},u.t,{absolute:o}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new P(r,u.t.routes[r],u.t),u.u=u.l(n)}return u}i=t,(n=u).prototype=Object.create(i.prototype),n.prototype.constructor=n,o(n,i);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,n){var o;return e({},r,((o={})[n]=t.u[n],o))},{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return R;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||R.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=l.default;if(void 0!==t.format){if(!b.call(l.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=l.formatters[e],o=R.filter;return("function"==typeof t.filter||m(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:R.addQueryPrefix,allowDots:void 0===t.allowDots?R.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:R.charsetSentinel,delimiter:void 0===t.delimiter?R.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:R.encode,encoder:"function"==typeof t.encoder?t.encoder:R.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:R.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:R.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:R.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:R.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):m(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=h[r&&r.arrayFormat in h?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=0;f<e.length;++f){var a=e[f];o.skipNulls&&null===n[a]||w(i,S(n[a],a,u,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset))}var c=i.join(o.delimiter),s=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&(s+="iso-8859-1"===o.charset?"utf8=%26%2310003%3B&":"utf8=%E2%9C%93&"),c.length>0?s+c:""}(e({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.v=function(t){var r=this;t?this.t.absolute&&t.startsWith("/")&&(t=this.p().host+t):t=this.h();var n={},o=Object.entries(this.t.routes).find(function(e){return n=new P(e[0],e[1],r.t).matchesUrl(t)})||[void 0,void 0];return e({name:o[0]},n,{route:o[1]})},f.h=function(){var t=this.p(),r=t.pathname,e=t.search;return(this.t.absolute?t.host+r:r.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"))+e},f.current=function(t,r){var n=this.v(),o=n.name,i=n.params,u=n.query,f=n.route;if(!t)return o;var a=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(o);if([null,void 0].includes(r)||!a)return a;var c=new P(o,f,this.t);r=this.l(r,c);var l=e({},i,u);return!(!Object.values(r).every(function(t){return!t})||Object.values(l).some(function(t){return void 0!==t}))||Object.entries(r).every(function(t){return l[t[0]]==t[1]})},f.p=function(){var t,r,e,n,o,i,u="undefined"!=typeof window?window.location:{},f=u.host,a=u.pathname,c=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:void 0===a?"":a,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:void 0===c?"":c}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.l=function(t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=this.i),null!=t||(t={}),t=["string","number"].includes(typeof t)?[t]:t;var o=r.parameterSegments.filter(function(t){return!n.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,n){var i,u;return e({},t,o[n]?((i={})[o[n].name]=r,i):"object"==typeof r?r:((u={})[r]="",u))},{});else if(1===o.length&&!t[o[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var i;(i={})[o[0].name]=t,t=i}return e({},this.m(r),this.g(t,r))},f.m=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,n,o){var i,u=n.name;return e({},t,((i={})[u]=r.t.defaults[u],i))},{})},f.g=function(t,r){var n=r.bindings,o=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var i,u,f=r[0],a=r[1];if(!a||"object"!=typeof a||Array.isArray(a)||!o.some(function(t){return t.name===f}))return e({},t,((u={})[f]=a,u));if(!a.hasOwnProperty(n[f])){if(!a.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+n[f]+"'.");n[f]="id"}return e({},t,((i={})[f]=a[n[f]],i))},{})},f.valueOf=function(){return this.toString()},f.check=function(t){return this.has(t)},r(u,[{key:"params",get:function(){var t=this.v();return e({},t.params,t.query)}}]),u}(/*#__PURE__*/u(String));return function(t,r,e,n){var o=new $(t,r,e,n);return t?o.toString():o}}); 562 563 564mw.uploadGlobalSettings = { 565 on: { 566 beforeFileUpload: function (instance) { 567 return new Promise(function (resolve){ 568 var tokenFromCookie = mw.cookie.get("XSRF-TOKEN"); 569 let xhr = new XMLHttpRequest() 570 xhr.open('POST', route('csrf-validate-token'), true) 571 xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8') 572 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest') 573 xhr.setRequestHeader('X-XSRF-TOKEN', tokenFromCookie) 574 xhr.send(''); 575 xhr.onload = function (res) { 576 577 if(xhr.status === 400) { 578 mw.cookie.delete("XSRF-TOKEN") 579 $.post(route('csrf'), function (res) { 580 var tokenFromCookie = mw.cookie.get("XSRF-TOKEN"); 581 $.ajaxSetup({ 582 headers: { 583 'X-XSRF-TOKEN': tokenFromCookie 584 } 585 }); 586 resolve(); 587 }); 588 } else { 589 resolve(); 590 } 591 } 592 }); 593 } 594 } 595} 596 597 598 599if (typeof Object.assign !== 'function') { 600 Object.defineProperty(Object, "assign", { 601 value: function assign(target) { 602 'use strict'; 603 if (target === null || target === undefined) { 604 throw new TypeError('Cannot convert undefined or null to object'); 605 } 606 var to = Object(target); 607 for (var index = 1; index < arguments.length; index++) { 608 var nextSource = arguments[index]; 609 if (nextSource !== null && nextSource !== undefined) { 610 for (var nextKey in nextSource) { 611 if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { 612 to[nextKey] = nextSource[nextKey]; 613 } 614 } 615 } 616 } 617 return to; 618 }, 619 writable: true, 620 configurable: true 621 }); 622} 623 624 625 626 627if (!window.jQuery) { 628
vendor: 15,088 bytes, lines 629-630
629/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ 630!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}
vendor: 4,356 bytes, line 630
630:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];
vendor: 10,068 bytes, line 630
630if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pe
vendor: 8,547 bytes, line 630
630nding",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone
vendor: 51,417 bytes, line 630
630=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
631 632 633/* 634 * jQuery Migrate - v3.0.0 - 2016-06-09 635 * Copyright jQuery Foundation and other contributors 636 */ 637(function( jQuery, window ) { 638"use strict"; 639 640 641jQuery.migrateVersion = "3.0.0"; 642 643 644( function() { 645return; 646 // Support: IE9 only 647 // IE9 only creates console object when dev tools are first opened 648 // Also, avoid Function#bind here to simplify PhantomJS usage 649 var log = window.console && window.console.log && 650 function() { window.console.log.apply( window.console, arguments ); }, 651 rbadVersions = /^[12]\./; 652 653 if ( !log ) { 654 return; 655 } 656 657 // Need jQuery 3.0.0+ and no older Migrate loaded 658 if ( !jQuery || rbadVersions.test( jQuery.fn.jquery ) ) { 659 log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" ); 660 } 661 if ( jQuery.migrateWarnings ) { 662 log( "JQMIGRATE: Migrate plugin loaded multiple times" ); 663 } 664 665 // Show a message on the console so devs know we're active 666 log( "JQMIGRATE: Migrate is installed" + 667 ( jQuery.migrateMute ? "" : " with logging active" ) + 668 ", version " + jQuery.migrateVersion ); 669 670} )(); 671 672var warnedAbout = {}; 673 674// List of warnings already given; public read only 675jQuery.migrateWarnings = []; 676 677// Set to false to disable traces that appear with warnings 678if ( jQuery.migrateTrace === undefined ) { 679 jQuery.migrateTrace = true; 680} 681 682// Forget any warnings we've already given; public 683jQuery.migrateReset = function() { 684 warnedAbout = {}; 685 jQuery.migrateWarnings.length = 0; 686}; 687 688function migrateWarn( msg ) { 689 return; 690 var console = window.console; 691 if ( !warnedAbout[ msg ] ) { 692 warnedAbout[ msg ] = true; 693 jQuery.migrateWarnings.push( msg ); 694 if ( console && console.warn && !jQuery.migrateMute ) { 695 console.warn( "JQMIGRATE: " + msg ); 696 if ( jQuery.migrateTrace && console.trace ) { 697 console.trace(); 698 } 699 } 700 } 701} 702 703function migrateWarnProp( obj, prop, value, msg ) { 704 Object.defineProperty( obj, prop, { 705 configurable: true, 706 enumerable: true, 707 get: function() { 708 migrateWarn( msg ); 709 return value; 710 } 711 } ); 712} 713 714if ( document.compatMode === "BackCompat" ) { 715 716 // JQuery has never supported or tested Quirks Mode 717 migrateWarn( "jQuery is not compatible with Quirks Mode" ); 718} 719 720 721var oldInit = jQuery.fn.init, 722 oldIsNumeric = jQuery.isNumeric, 723 oldFind = jQuery.find, 724 rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, 725 rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g; 726 727jQuery.fn.init = function( arg1 ) { 728 var args = Array.prototype.slice.call( arguments ); 729 730 if ( typeof arg1 === "string" && arg1 === "#" ) { 731 732 // JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0 733 migrateWarn( "jQuery( '#' ) is not a valid selector" ); 734 args[ 0 ] = []; 735 } 736 737 return oldInit.apply( this, args ); 738}; 739jQuery.fn.init.prototype = jQuery.fn; 740 741jQuery.find = function( selector ) { 742 var args = Array.prototype.slice.call( arguments ); 743 744 // Support: PhantomJS 1.x 745 // String#match fails to match when used with a //g RegExp, only on some strings 746 if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { 747 748 // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 749 // First see if qS thinks it's a valid selector, if so avoid a false positive 750 try { 751 document.querySelector( selector ); 752 } catch ( err1 ) { 753 754 // Didn't *look* valid to qSA, warn and try quoting what we think is the value 755 selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { 756 return "[" + attr + op + "\"" + value + "\"]"; 757 } ); 758 759 // If the regexp *may* have created an invalid selector, don't update it 760 // Note that there may be false alarms if selector uses jQuery extensions 761 try { 762 document.querySelector( selector ); 763 migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); 764 args[ 0 ] = selector; 765 } catch ( err2 ) { 766 migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); 767 } 768 } 769 } 770 771 return oldFind.apply( this, args ); 772}; 773 774// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) 775var findProp; 776for ( findProp in oldFind ) { 777 if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { 778 jQuery.find[ findProp ] = oldFind[ findProp ]; 779 } 780} 781 782// The number of elements contained in the matched element set 783jQuery.fn.size = function() { 784 migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" ); 785 return this.length; 786}; 787 788jQuery.parseJSON = function() { 789 migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" ); 790 return JSON.parse.apply( null, arguments ); 791}; 792 793jQuery.isNumeric = function( val ) { 794 795 // The jQuery 2.2.3 implementation of isNumeric 796 function isNumeric2( obj ) { 797 var realStringObj = obj && obj.toString(); 798 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 799 } 800 801 var newValue = oldIsNumeric( val ), 802 oldValue = isNumeric2( val ); 803 804 if ( newValue !== oldValue ) { 805 migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" ); 806 } 807 808 return oldValue; 809}; 810 811migrateWarnProp( jQuery, "unique", jQuery.uniqueSort, 812 "jQuery.unique is deprecated, use jQuery.uniqueSort" ); 813 814// Now jQuery.expr.pseudos is the standard incantation 815migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, 816 "jQuery.expr.filters is now jQuery.expr.pseudos" ); 817migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, 818 "jQuery.expr[\":\"] is now jQuery.expr.pseudos" ); 819 820 821var oldAjax = jQuery.ajax; 822 823jQuery.ajax = function( ) { 824 var jQXHR = oldAjax.apply( this, arguments ); 825 826 // Be sure we got a jQXHR (e.g., not sync) 827 if ( jQXHR.promise ) { 828 migrateWarnProp( jQXHR, "success", jQXHR.done, 829 "jQXHR.success is deprecated and removed" ); 830 migrateWarnProp( jQXHR, "error", jQXHR.fail, 831 "jQXHR.error is deprecated and removed" ); 832 migrateWarnProp( jQXHR, "complete", jQXHR.always, 833 "jQXHR.complete is deprecated and removed" ); 834 } 835 836 return jQXHR; 837}; 838 839 840var oldRemoveAttr = jQuery.fn.removeAttr, 841 oldToggleClass = jQuery.fn.toggleClass, 842 rmatchNonSpace = /\S+/g; 843 844jQuery.fn.removeAttr = function( name ) { 845 var self = this; 846
847 jQuery.each( name.match( rmatchNonSpace ), function( i, attr ) { 848 if ( jQuery.expr.match.bool.test( attr ) ) { 849 migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); 850 self.prop( attr, false ); 851 } 852 } ); 853 854 return oldRemoveAttr.apply( this, arguments ); 855}; 856 857jQuery.fn.toggleClass = function( state ) { 858 859 // Only deprecating no-args or single boolean arg 860 if ( state !== undefined && typeof state !== "boolean" ) { 861 return oldToggleClass.apply( this, arguments ); 862 } 863 864 migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" ); 865 866 // Toggle entire class name of each element 867 return this.each( function() { 868 var className = this.getAttribute && this.getAttribute( "class" ) || ""; 869 870 if ( className ) { 871 jQuery.data( this, "__className__", className ); 872 } 873 874 // If the element has a class name or if we're passed `false`, 875 // then remove the whole classname (if there was one, the above saved it). 876 // Otherwise bring back whatever was previously saved (if anything), 877 // falling back to the empty string if nothing was stored. 878 if ( this.setAttribute ) { 879 this.setAttribute( "class", 880 className || state === false ? 881 "" : 882 jQuery.data( this, "__className__" ) || "" 883 ); 884 } 885 } ); 886}; 887 888 889var internalSwapCall = false; 890 891// If this version of jQuery has .swap(), don't false-alarm on internal uses 892if ( jQuery.swap ) { 893 jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { 894 var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; 895 896 if ( oldHook ) { 897 jQuery.cssHooks[ name ].get = function() { 898 var ret; 899 900 internalSwapCall = true; 901 ret = oldHook.apply( this, arguments ); 902 internalSwapCall = false; 903 return ret; 904 }; 905 } 906 } ); 907} 908 909jQuery.swap = function( elem, options, callback, args ) { 910 var ret, name, 911 old = {}; 912 913 if ( !internalSwapCall ) { 914 migrateWarn( "jQuery.swap() is undocumented and deprecated" ); 915 } 916 917 // Remember the old values, and insert the new ones 918 for ( name in options ) { 919 old[ name ] = elem.style[ name ]; 920 elem.style[ name ] = options[ name ]; 921 } 922 923 ret = callback.apply( elem, args || [] ); 924 925 // Revert the old values 926 for ( name in options ) { 927 elem.style[ name ] = old[ name ]; 928 } 929 930 return ret; 931}; 932 933var oldData = jQuery.data; 934 935jQuery.data = function( elem, name, value ) { 936 var curData; 937 938 // If the name is transformed, look for the un-transformed name in the data object 939 if ( name && name !== jQuery.camelCase( name ) ) { 940 curData = jQuery.hasData( elem ) && oldData.call( this, elem ); 941 if ( curData && name in curData ) { 942 migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name ); 943 if ( arguments.length > 2 ) { 944 curData[ name ] = value; 945 } 946 return curData[ name ]; 947 } 948 } 949 950 return oldData.apply( this, arguments ); 951}; 952 953var oldTweenRun = jQuery.Tween.prototype.run; 954 955jQuery.Tween.prototype.run = function( percent ) { 956 if ( jQuery.easing[ this.easing ].length > 1 ) { 957 migrateWarn( 958 "easing function " + 959 "\"jQuery.easing." + this.easing.toString() + 960 "\" should use only first argument" 961 ); 962 963 jQuery.easing[ this.easing ] = jQuery.easing[ this.easing ].bind( 964 jQuery.easing, 965 percent, this.options.duration * percent, 0, 1, this.options.duration 966 ); 967 } 968 969 oldTweenRun.apply( this, arguments ); 970}; 971 972var oldLoad = jQuery.fn.load, 973 originalFix = jQuery.event.fix; 974 975jQuery.event.props = []; 976jQuery.event.fixHooks = {}; 977 978jQuery.event.fix = function( originalEvent ) { 979 var event, 980 type = originalEvent.type, 981 fixHook = this.fixHooks[ type ], 982 props = jQuery.event.props; 983 984 if ( props.length ) { 985 migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() ); 986 while ( props.length ) { 987 jQuery.event.addProp( props.pop() ); 988 } 989 } 990 991 if ( fixHook && !fixHook._migrated_ ) { 992 fixHook._migrated_ = true; 993 migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type ); 994 if ( ( props = fixHook.props ) && props.length ) { 995 while ( props.length ) { 996 jQuery.event.addProp( props.pop() ); 997 } 998 } 999 } 1000 1001 event = originalFix.call( this, originalEvent ); 1002 1003 return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 1004}; 1005 1006jQuery.each( [ "load", "unload", "error" ], function( _, name ) { 1007 1008 jQuery.fn[ name ] = function() { 1009 var args = Array.prototype.slice.call( arguments, 0 ); 1010 1011 // If this is an ajax load() the first arg should be the string URL; 1012 // technically this could also be the "Anything" arg of the event .load() 1013 // which just goes to show why this dumb signature has been deprecated! 1014 // jQuery custom builds that exclude the Ajax module justifiably die here. 1015 if ( name === "load" && typeof args[ 0 ] === "string" ) { 1016 return oldLoad.apply( this, args ); 1017 } 1018 1019 migrateWarn( "jQuery.fn." + name + "() is deprecated" ); 1020 1021 args.splice( 0, 0, name ); 1022 if ( arguments.length ) { 1023 return this.on.apply( this, args ); 1024 } 1025 1026 // Use .triggerHandler here because: 1027 // - load and unload events don't need to bubble, only applied to window or image 1028 // - error event should not bubble to window, although it does pre-1.7 1029 // See http://bugs.jquery.com/ticket/11820 1030 this.triggerHandler.apply( this, args ); 1031 return this; 1032 }; 1033 1034} ); 1035 1036// Trigger "ready" event only once, on document ready 1037jQuery( function() { 1038 jQuery( document ).triggerHandler( "ready" ); 1039} ); 1040 1041jQuery.event.special.ready = { 1042 setup: function() { 1043 if ( this === document ) { 1044 migrateWarn( "'ready' event is deprecated" ); 1045 } 1046 } 1047}; 1048 1049jQuery.fn.extend( { 1050 1051 bind: function( types, data, fn ) { 1052 migrateWarn( "jQuery.fn.bind() is deprecated" ); 1053 return this.on( types, null, data, fn ); 1054 }, 1055 unbind: function( types, fn ) { 1056 migrateWarn( "jQuery.fn.unbind() is deprecated" ); 1057 return this.off( types, null, fn ); 1058 }, 1059 delegate: function( selector, types, data, fn ) { 1060 migrateWarn( "jQuery.fn.delegate() is deprecated" ); 1061 return this.on( types, selector, data, fn ); 1062 }, 1063 undelegate: function( selector, types, fn ) { 1064 migrateWarn( "jQuery.fn.undelegate() is deprecated" ); 1065 return arguments.length === 1 ? 1066 this.off( selector, "**" ) : 1067 this.off( types, selector || "**", fn ); 1068 } 1069} ); 1070 1071 1072var oldOffset = jQuery.fn.offset; 1073 1074jQuery.fn.offset = function() { 1075 var docElem, 1076 elem = this[ 0 ], 1077 origin = { top: 0, left: 0 }; 1078 1079 if ( !elem || !elem.nodeType ) { 1080 migrateWarn( "jQuery.fn.offset() requires a valid DOM element" ); 1081 return origin; 1082 } 1083 1084 docElem = ( elem.ownerDocument || document ).documentElement; 1085 if ( !jQuery.contains( docElem, elem ) ) { 1086 migrateWarn( "jQuery.fn.offset() requires an element connected to a document" ); 1087 return origin; 1088 } 1089 1090 return oldOffset.apply( this, arguments ); 1091}; 1092 1093 1094var oldParam = jQuery.param; 1095 1096jQuery.param = function( data, traditional ) { 1097 var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 1098 1099 if ( traditional === undefined && ajaxTraditional ) { 1100 1101 migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); 1102 traditional = ajaxTraditional; 1103 } 1104 1105 return oldParam.call( this, data, traditional ); 1106}; 1107 1108var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; 1109 1110jQuery.fn.andSelf = function() { 1111 migrateWarn( "jQuery.fn.andSelf() replaced by jQuery.fn.addBack()" ); 1112 return oldSelf.apply( this, arguments ); 1113}; 1114 1115 1116var oldDeferred = jQuery.Deferred, 1117 tuples = [ 1118 1119 // Action, add listener, callbacks, .then handlers, final state 1120 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 1121 jQuery.Callbacks( "once memory" ), "resolved" ], 1122 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 1123 jQuery.Callbacks( "once memory" ), "rejected" ], 1124 [ "notify", "progress", jQuery.Callbacks( "memory" ), 1125 jQuery.Callbacks( "memory" ) ] 1126 ]; 1127 1128jQuery.Deferred = function( func ) { 1129 var deferred = oldDeferred(), 1130 promise = deferred.promise(); 1131 1132 deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) { 1133 var fns = arguments; 1134 1135 migrateWarn( "deferred.pipe() is deprecated" ); 1136 1137 return jQuery.Deferred( function( newDefer ) { 1138 jQuery.each( tuples, function( i, tuple ) { 1139 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 1140 1141 // Deferred.done(function() { bind to newDefer or newDefer.resolve }) 1142 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 1143 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 1144 deferred[ tuple[ 1 ] ]( function() { 1145 var returned = fn && fn.apply( this, arguments ); 1146 if ( returned && jQuery.isFunction( returned.promise ) ) { 1147 returned.promise() 1148 .done( newDefer.resolve ) 1149 .fail( newDefer.reject ) 1150 .progress( newDefer.notify ); 1151 } else { 1152 newDefer[ tuple[ 0 ] + "With" ]( 1153 this === promise ? newDefer.promise() : this, 1154 fn ? [ returned ] : arguments 1155 ); 1156 } 1157 } ); 1158 } ); 1159 fns = null; 1160 } ).promise(); 1161 1162 }; 1163 1164 if ( func ) { 1165 func.call( deferred, deferred ); 1166 } 1167 1168 return deferred; 1169}; 1170 1171 1172 1173})( jQuery, window ); 1174 1175 1176} 1177 1178var _jqxhr = jQuery.ajax; 1179mw.jqxhr = _jqxhr; 1180 1181 1182 1183jQuery.ajax = function(url, options){ 1184 options = options || {}; 1185 var settings = {}; 1186 if(typeof url === 'object'){ 1187 $.extend(settings, url); 1188 } 1189 else{ 1190 settings.url = url; 1191 } 1192 1193 1194 if(typeof settings.success === 'function'){ 1195 settings._success = settings.success; 1196 delete settings.success; 1197 } 1198 1199 settings.success = function (data, status, xhr) { 1200 if(xhr.status === 200) { 1201 if (data && (data.form_data_required || data.form_data_module)) { 1202 mw.extradataForm(settings, data); 1203 } 1204 else { 1205 if (typeof this._success === 'function') { 1206 var scope = this; 1207 scope._success.call(scope, data, status, xhr); 1208 1209 } 1210 } 1211 } 1212 }; 1213 1214 settings = $.extend({}, settings, options); 1215 var xhr = _jqxhr(settings); 1216 xhr._settings = settings; 1217 return xhr; 1218}; 1219 1220mw.safeCallCache = {}; 1221 1222mw.safeCall = function(hash, call){ 1223 if(!mw.safeCallCache[hash]){ 1224 mw.safeCallCache[hash] = true; 1225 call.call(); 1226 (function(hash){ 1227 setTimeout(function(){ 1228 delete mw.safeCallCache[hash]; 1229 }); 1230 })(hash); 1231 } 1232}; 1233 1234$.ajaxSetup({ 1235 cache: false, 1236 error: function (xhr, e, c, d) { 1237 var data = xhr.responseJSON; 1238 if (data && (data.form_data_required || data.form_data_module)) { 1239 mw.extradataForm(xhr._settings, data); 1240 return; 1241 } 1242 if(xhr.status === 422){ 1243 mw.errorsHandle(xhr.responseJSON) 1244 } else if(xhr.status !== 200 && xhr.status !== 0){ 1245 mw.notification.error('Error ' + xhr.status + ' - ' + xhr.statusText + ' - \r\n' + xhr.responseText ); 1246 setTimeout(function(){ 1247 mw.tools.loading(false); 1248 }, 333); 1249 } 1250 } 1251}); 1252 1253 1254 1255 1256 1257mw.version = "2.0.17"; 1258 1259mw.pauseSave = false;
1260 1261mw.askusertostay = false; 1262 1263 if (top === self){ 1264 window.onbeforeunload = function() { 1265 if(mw.askusertostay){ 1266 mw.notification.warning("You have unsaved changes!"); 1267 return "You have unsaved changes!"; 1268 } 1269 } 1270 } 1271 1272 warnOnLeave = function(){ 1273 mw.tools.confirm("You have unsaved changes! Are you sure?"); 1274 }; 1275 1276 mw.module = { 1277 inViewport(el) { 1278 if(!el || !el.parentNode) { 1279 return false; 1280 } 1281 1282 const doc = el.ownerDocument; 1283 const win = doc.defaultView; 1284 1285 1286 const bounding = el.getBoundingClientRect(); 1287 const elHeight = el.offsetHeight; 1288 const elWidth = el.offsetWidth; 1289 1290 1291 1292 if (bounding.top >= -elHeight 1293 && bounding.left >= -elWidth 1294 && bounding.right <= (win.innerWidth || doc.documentElement.clientWidth) + elWidth 1295 && bounding.bottom <= (win.innerHeight || doc.documentElement.clientHeight) + elHeight) { 1296 1297 return true; 1298 } else { 1299 1300 return false 1301 } 1302 }, 1303 insert: function(target, module, config, pos, stateManager, explicitAction) { 1304 1305 1306 1307 1308 return new Promise(function (resolve) { 1309 pos = pos || 'bottom'; 1310 var action; 1311 var id = mw.id('mw-module-'), 1312 el = '<div id="' + id + '"></div>'; 1313 1314 if (pos === 'top') { 1315 action = 'before'; 1316 if(mw.tools.hasAnyOfClasses(target, ['allow-drop', 'mw-col'])) { 1317 action = 'prepend'; 1318 } 1319 } else if (pos === 'bottom') { 1320 action = 'after'; 1321 if(mw.tools.hasAnyOfClasses(target, ['allow-drop', 'mw-col'])) { 1322 action = 'append'; 1323 } 1324 } 1325 if(mw.tools.hasAnyOfClasses(target, [ 'mw-col'])) { 1326 if(target.firstElementChild.classList.contains('mw-col-container')) { 1327 target = target.firstElementChild; 1328 if(target.firstElementChild.classList.contains('mw-empty-element')) { 1329 target = target.firstElementChild 1330 } 1331 } 1332 } 1333 //if element is image and has a link 1334 if( target.nodeName == 'IMG' && target.parentNode && target.parentNode.nodeName === 'A'){ 1335 target = target.parentNode; 1336 } 1337 1338 if(target.classList && target.classList.contains('edit')) { 1339 if(pos === 'top' || action === 'before') { 1340 action = 'prepend' 1341 } else if(pos === 'bottom' || action === 'after') { 1342 action = 'append' 1343 } 1344 } 1345 1346 1347 var parent = mw.$(target).parent().get(0); 1348 if(!parent){ 1349 parent = mw.tools.firstParentOrCurrentWithAnyOfClasses(target, ['edit', 'module']); 1350 } 1351 if(!parent){ 1352 parent = target; 1353 } 1354 1355 if(stateManager) { 1356 stateManager.record({ 1357 target: parent, 1358 value: parent.innerHTML 1359 }); 1360 } 1361 1362 if(pos === 'append') { 1363 action = 'append' 1364 } 1365 if(pos === 'prepend') { 1366 action = 'prepend' 1367 } 1368 1369 1370 if(target.classList.contains('mw-free-layout-container')) { 1371 action = 'append' 1372 } 1373 1374 1375 1376 if(target.nodeName === 'TD' && !explicitAction) { 1377 if(action === 'before') { 1378 action = 'prepend' 1379 } else if(action === 'after') { 1380 action = 'append' 1381 } 1382 } 1383 1384 1385 mw.$(target)[explicitAction || action](el); 1386 mw.load_module(module, '#' + id, function (a,b) { 1387 if(stateManager) { 1388 stateManager.record({ 1389 target: parent, 1390 value: parent.innerHTML 1391 }); 1392 } 1393 1394 if(!mw.module.inViewport(document.querySelector('#' + id))) { 1395 mw.tools.scrollTo('#' + id); 1396 } 1397 1398 1399 1400 1401 1402 resolve(this); 1403 }, config); 1404 }); 1405 } 1406 } 1407 1408 mwd = document; 1409 1410 mww = window; 1411 1412 mwhead = document.head || document.getElementsByTagName('head')[0]; 1413 1414 mw.doc = mwd; 1415 mw.win = window; 1416 mw.head = mwhead; 1417 1418 mw.loaded = false;
1419 1420 mw._random = new Date().getTime(); 1421 1422 mw.random = function() { 1423 return mw._random++; 1424 }; 1425 1426 mw.id = function(prefix) { 1427 prefix = prefix || 'mw-'; 1428 return prefix + mw.random(); 1429 }; 1430 1431 String.prototype.contains = function(a) { 1432 return !!~this.indexOf(a); 1433 }; 1434 1435 mw.onLive = function(callback) { 1436 if (typeof mw.settings.liveEdit === 'boolean' && mw.settings.liveEdit) { 1437 callback.call(this) 1438 } 1439 }; 1440 mw.onAdmin = function(callback) { 1441 if ( window['mwAdmin'] ) { 1442 callback.call(this); 1443 } 1444 }; 1445 1446 1447 1448 mw.required = typeof mw.required === 'undefined'?[]:mw.required; 1449 mw.require = function(url, inHead, key, defered) { 1450 if(!url) return; 1451 var defer; 1452 if(defered) { 1453 defer = ' defer '; 1454 } else { 1455 defer = ' ' 1456 } 1457 if(typeof inHead === 'boolean' || typeof inHead === 'undefined'){ 1458 inHead = inHead || false; 1459 } 1460 var keyString; 1461 if(typeof inHead === 'string'){ 1462 keyString = ''+inHead; 1463 inHead = key || false; 1464 } 1465 if(typeof key === 'string'){ 1466 keyString = key; 1467 } 1468 var toPush = url, urlModified = false; 1469 if (!!keyString) { 1470 toPush = keyString; 1471 urlModified = true 1472 } 1473 var t = url.split('.').pop(); 1474 url = url.contains('//') ? url : (t !== "css" ? "https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/" + url : "https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/css/" + url); 1475 if(!urlModified) toPush = url; 1476 if (!~mw.required.indexOf(toPush)) { 1477 1478 mw.required.push(toPush); 1479 url = url.contains("?") ? url + '&mwv=' + mw.version : url + "?mwv=" + mw.version; 1480 if(document.querySelector('link[href="'+url+'"],script[src="'+url+'"]') !== null){ 1481 return 1482 } 1483 1484 var cssRel = " rel='stylesheet' "; 1485 1486 if(defered){ 1487 cssRel = " rel='preload' as='style' onload='this.onload=null;this.rel=\'stylesheet\'' "; 1488 } 1489 1490 1491 var string = t !== "css" ? "<script "+defer+" src='" + url + "'></script>" : "<link "+cssRel+" href='" + url + "' />"; 1492 1493 if(typeof $.fn === 'object'){ 1494 $(mwhead).append(string); 1495 } 1496 else{ 1497 var el; 1498 if( t !== "css") { 1499 el = document.createElement('script'); 1500 el.src = url; 1501 el.defer = !!defer; 1502 el.setAttribute('type', 'text/javascript'); 1503 mwhead.appendChild(el); 1504 } 1505 else{ 1506 1507 el = document.createElement('link'); 1508 if(defered) { 1509 el.as='style'; 1510 el.rel='preload'; 1511 el.addEventListener('load', e => el.rel='stylesheet'); 1512 } else { 1513 el.rel='stylesheet'; 1514 } 1515 1516 1517 el.href = url; 1518 mwhead.appendChild(el); 1519 } 1520 } 1521 1522 } 1523 }; 1524 1525 1526 1527mw.getScripts = function (array, callback) { 1528 if(typeof array === 'string'){ 1529 array = array.split(',') 1530 } 1531 array = array.filter(function (item) { 1532 return !!item.trim(); 1533 }); 1534 var all = array.length, ready = 0; 1535 $.each(array, function(){ 1536 $.getScript(this.indexOf('//') !== -1 ? this : mw.settings.includes_url + 'api/' + this, function (){ 1537 ready++; 1538 if(all === ready) { 1539 callback.call() 1540 } 1541 }) 1542 1543 }); 1544}; 1545 1546mw.requireAsync = (url, key) => { 1547 return new Promise(resolve => { 1548 if(mw.required.includes(url)) { 1549 resolve(); 1550 } else { 1551 mw.required.push(url); 1552 mw.getScripts(url, () => { 1553 resolve(); 1554 }) 1555 } 1556 }); 1557} 1558 1559 mw.moduleCSS = mw.module_css = function(url){ 1560 if (!~mw.required.indexOf(url)) { 1561 mw.required.push(url); 1562 var el = document.createElement('link'); 1563 el.as='style'; 1564 el.rel='preload'; 1565 el.addEventListener('load', e => el.rel='stylesheet'); 1566 el.href = url; 1567 mwhead.insertBefore(el, mwhead.firstChild); 1568 } 1569 }; 1570 mw.moduleJS = mw.module_js = function(url){ 1571 mw.require(url, true); 1572 }; 1573 1574 1575 mw.target = {} 1576 1577 mw.is = { 1578 obj: function(obj) { 1579 return typeof obj === 'object'; 1580 }, 1581 func: function(obj) { 1582 return typeof obj === 'function'; 1583 }, 1584 string: function(obj) { 1585 return typeof obj === 'string'; 1586 }, 1587 array:function(obj){ 1588 return [].constructor === obj.constructor; 1589 }, 1590 invisible: function(obj) { 1591 return window.getComputedStyle(obj, null).visibility === 'hidden'; 1592 }, 1593 visible: function(obj) { 1594 return window.getComputedStyle(obj, null).visibility === 'visible'; 1595 }, 1596 ie: (/*@cc_on!@*/false || !!window.MSStream) && !navigator.userAgent.match(/Trident\/7\./) && false, 1597 firefox:navigator.userAgent.toLowerCase().contains('firefox') 1598 } 1599 1600 1601/* 1602 * Microweber - Javascript Framework 1603 * 1604 * Copyright (c) Licensed under the Microweber 1605 * license http://microweber.com/license 1606 * 1607 */ 1608 1609 mw.load_module = function(name, selector, callback, attributes) { 1610 attributes = attributes || {}; 1611 attributes.module = name; 1612 return mw._({ 1613 selector: selector, 1614 params: attributes, 1615 done: function() { 1616 mw.settings.sortables_created = false;
1617 if (mw.is.func(callback)) { 1618 callback.call(this); 1619 } 1620 } 1621 }); 1622 } 1623 1624 mw.loadModuleData = function(name, update_element, callback, attributes){ 1625 1626 1627 var attributes = attributes || {}; 1628 1629 if(typeof update_element == 'function'){ 1630 var callback = update_element; 1631 } 1632 var update_element = document.createElement('div'); 1633 attributes.module = name; 1634 mw._({ 1635 selector: update_element, 1636 params: attributes 1637 }, false, true) 1638 .done(function(data){ 1639 1640 setTimeout(function(){ 1641 callback.call(this, data); 1642 $(document).off('focusin.modal'); 1643 }, 50) 1644 1645 }); 1646 } 1647 mw.getModule = function(name, params, callback){ 1648 if( typeof params == 'function'){ 1649 callback = params; 1650 } 1651 params = params || {}; 1652 var update_element = document.createElement('div'); 1653 for(var x in params){ 1654 update_element.setAttribute(x, params[x]); 1655 } 1656 mw.loadModuleData(name, update_element, function(a){ 1657 callback.call(a); 1658 }); 1659 } 1660 1661 mw.reload_module_intervals = {}; 1662 mw.reload_module_interval = function(module_name, interval) { 1663 interval = interval || 1000; 1664 var obj = {pause:false}; 1665 if(!!mw.reload_module_intervals[module_name]){ 1666 clearInterval(mw.reload_module_intervals[module_name]); 1667 } 1668 mw.reload_module_intervals[module_name] = setInterval(function(){ 1669 if(!obj.pause){ 1670 obj.pause = true; 1671 mw.reload_module(module_name, function(){ 1672 obj.pause = false; 1673 }); 1674 } 1675 }, interval); 1676 return mw.reload_module_intervals['module_name']; 1677 } 1678 1679 mw.reload_module_parent = function(module, callback) { 1680 if(self !== parent && !!parent.mw){ 1681 1682 mw.parent().reload_module(module, callback) 1683 if(typeof(mw.top().win.mweditor) != 'undefined' && typeof(mw.top().win.mweditor) == 'object' && typeof(mw.top().win.mweditor.contentWindow) != 'undefined'){ 1684 mw.top().win.mweditor.contentWindow.mw.reload_module(module, callback) 1685 } else if(typeof(mw.top().win.iframe_editor_window) != 'undefined' && typeof(mw.top().win.iframe_editor_window) == 'object' && typeof(mw.top().win.iframe_editor_window.mw) != 'undefined'){ 1686 1687 mw.top().win.iframe_editor_window.mw.reload_module(module, callback) 1688 } 1689 1690 if(typeof(parent.mw_preview_frame_object) != 'undefined' && typeof(parent.mw_preview_frame_object) == 'object' && typeof(parent.mw_preview_frame_object.contentWindow) != 'undefined'){ 1691 if(parent.mw_preview_frame_object.contentWindow != null && typeof(parent.mw_preview_frame_object.contentWindow.mw) != 'undefined'){ 1692 parent.mw_preview_frame_object.contentWindow.mw.reload_module(module, callback) 1693 } 1694 } 1695 } else { 1696 if(typeof(mweditor) != 'undefined' && typeof(mweditor) == 'object' && typeof(mweditor.contentWindow) != 'undefined' && typeof(mweditor.contentWindow.mw) != 'undefined'){ 1697 mweditor.contentWindow.mw.reload_module(module, callback) 1698 } 1699 1700 } 1701 } 1702 mw.reload_modules = function(array, callback, simultaneously) { 1703 if(array.array && !array.slice){ 1704 callback = array.callback || array.done || array.ready; 1705 simultaneously = array.simultaneously; 1706 array = array.array; 1707 } 1708 simultaneously = simultaneously || false; 1709 if(simultaneously){ 1710 var l = array.length, ready = 0, i = 0; 1711 for( ; i<l; i++){ 1712 mw.reload_module(array[i], function(){ 1713 ready++; 1714 if(ready === l && callback){ 1715 callback.call(); 1716 } 1717 }); 1718 } 1719 } 1720 else{ 1721 if(array.length === 0){ 1722 if(callback){ 1723 callback.call() 1724 } 1725 } 1726 else{ 1727 var m = array[0]; 1728 array.shift(); 1729 mw.reload_module(m, function(){ 1730 mw.reload_modules(array, callback, false); 1731 }); 1732 } 1733 } 1734 }; 1735 mw.reload_module_everywhere = function(module, eachCallback) { 1736 1737 mw.tools.eachWindow(function () { 1738 1739 1740 1741 if(this.mw && this.mw.reload_module){ 1742 1743 this.mw.reload_module(module, function(){ 1744 1745 if(typeof eachCallback === 'function'){ 1746 eachCallback.call(this); 1747 } 1748 }) 1749 } 1750 }) 1751 }; 1752 1753 mw.reload_module = function(module, callback) { 1754 1755 if(Array.isArray(module)){ 1756 var l = module.length, i=0, w = 1; 1757 for( ; i<l; i++){ 1758 mw.reload_module(module[i], function(){ 1759 w++; 1760 if(w === l && typeof callback === 'function'){ 1761 callback.call(); 1762 } 1763 $( this ).trigger('ModuleReload') 1764 1765 // 1766 // if(self !== top && top && top.mw) { 1767 // if (module[i] && module[i].id) { 1768 // mw.top().app.dispatch('onModuleReloaded', module[i].id); 1769 // } 1770 // } 1771 1772 }); 1773 } 1774 return false;
1775 } 1776 var currId = false; 1777 var doc = false; 1778 1779 var done = callback || function(){}; 1780 if (typeof module !== 'undefined') { 1781 if (typeof module === 'object') { 1782 1783 if(mw.top().app && mw.top().app.liveEdit && mw.top().app.liveEdit.handles.get('module')) { 1784 var curr = mw.top().app.liveEdit.handles.get('module').getTarget(); 1785 if (curr && curr === module) { 1786 currId = curr.id; 1787 doc = curr.ownerDocument; 1788 } 1789 } 1790 1791 var xhr = mw._({ 1792 selector: module, 1793 done: done 1794 }); 1795 1796 1797 1798 if(xhr) { 1799 xhr.success(function(){ 1800 if (mw.top().app && mw.top().app.liveEdit && mw.top().app.liveEdit.handles.get('module')) { 1801 if (doc) { 1802 var newNode = doc.getElementById(currId); 1803 if (newNode) { 1804 mw.top().app.liveEdit.handles.get('module').set(newNode); 1805 mw.top().app.liveEdit.handles.get('module').position(newNode); 1806 } 1807 } 1808 } 1809 }); 1810 } 1811 1812 } else { 1813 var module_name = module.toString(); 1814 var refresh_modules_explode = module_name.split(","); 1815 for (var i = 0; i < refresh_modules_explode.length; i++) { 1816 module = refresh_modules_explode[i]; 1817 if (typeof module != 'undefined') { 1818 module = module.replace(/##/g, '#'); 1819 var m = mw.$(".module[data-type='" + module + "']"); 1820 if (m.length === 0) { 1821 try { m = $(module); } catch(e) {}; 1822 } 1823 1824 1825 1826 if( !m.length && typeof callback === 'function'){ 1827 callback.call(); 1828 } 1829 1830 (function(callback){ 1831 var count = 0; 1832 for (var i=0;i<m.length;i++){ 1833 mw.reload_module(m[i], function(){ 1834 count++; 1835 if(count === m.length && typeof callback === 'function'){ 1836 callback.call(); 1837 } 1838 $( document ).trigger('ModuleReload') 1839 }) 1840 } 1841 })(callback) 1842 1843 1844 } 1845 } 1846 } 1847 } else { 1848 if( typeof callback === 'function'){ 1849 callback.call(); 1850 } 1851 } 1852 1853 } 1854 1855 mw.clear_cache = function() { 1856 $.ajax({ 1857 url: mw.settings.site_url+'api/clearcache', 1858 type: "POST", 1859 success: function(data){ 1860 if(mw.notification != undefined){ 1861 mw.notification.msg(data); 1862 1863 } 1864 } 1865 }); 1866 } 1867 1868 1869 mw.temp_reload_module_queue_holder = []; 1870 1871 1872 1873 1874 mw["_"] = function(obj, sendSpecific, DONOTREPLACE) { 1875 if(mw.on){ 1876 mw.on.DOMChangePause = true; 1877 } 1878 var url = typeof obj.url !== 'undefined' ? obj.url : mw.settings.site_url+'module/'; 1879 var selector = typeof obj.selector !== 'undefined' ? obj.selector : ''; 1880 var params = typeof obj.params !== 'undefined' ? obj.params : {}; 1881 var to_send = params; 1882 if(typeof $(obj.selector)[0] === 'undefined') { 1883 mw.pauseSave = false; 1884 mw.on.DOMChangePause = false; 1885 return false; 1886 } 1887 if(mw.session){ 1888 mw.session.checkPause = true; 1889 } 1890 var $node = $(obj.selector); 1891 var node = $node[0]; 1892 var attrs = node.attributes; 1893 1894 1895 1896 // wait between many reloads 1897 if (node.id) { 1898 if ( mw.temp_reload_module_queue_holder.indexOf(node.id) === -1){ 1899 mw.temp_reload_module_queue_holder.push(node.id); 1900 setTimeout(function() { 1901 var reload_index = mw.temp_reload_module_queue_holder.indexOf(node.id); 1902 delete mw.temp_reload_module_queue_holder[reload_index]; 1903 }, 300); 1904 } else { 1905 return; 1906 } 1907 } 1908 1909 if (sendSpecific) { 1910 attrs["class"] !== undefined ? to_send["class"] = attrs["class"].nodeValue : ""; 1911 attrs["data-module-name"] !== undefined ? to_send["data-module-name"] = attrs["data-module-name"].nodeValue : ""; 1912 attrs["data-type"] !== undefined ? to_send["data-type"] = attrs["data-type"].nodeValue : ""; 1913 attrs["type"] !== undefined ? to_send["type"] = attrs["type"].nodeValue : ""; 1914 attrs["template"] !== undefined ? to_send["template"] = attrs["template"].nodeValue : ""; 1915 attrs["ondrop"] !== undefined ? to_send["ondrop"] = attrs["ondrop"].nodeValue : ""; 1916 } 1917 else { 1918 for (var i in attrs) { 1919 if(attrs[i] !== undefined){ 1920 var name = attrs[i].name; 1921 var val = attrs[i].nodeValue; 1922 if(typeof to_send[name] === 'undefined'){ 1923 to_send[name] = val; 1924 } 1925 } 1926 } 1927 } 1928 var b = true; 1929 for (var a in to_send) { 1930 if(to_send.hasOwnProperty(a)) { b = false; } 1931 } 1932 if(b){ 1933 mw.tools.removeClass(document.body, 'loading'); 1934 mw.pauseSave = false;
1935 mw.on.DOMChangePause = false; 1936 return false; 1937 } 1938 var storedValues = $node.dataset('storeValues') === 'true' ? {} : false; 1939 if(storedValues) { 1940 $node.find('[name]').each(function () { 1941 storedValues[this.name] = $(this).val(); 1942 }) 1943 } 1944 1945 var xhr = $.post(url, to_send, function(data) { 1946 1947 if(!!mw.session){ 1948 mw.session.checkPause = false; 1949 } 1950 if(DONOTREPLACE){ 1951 1952 mw.tools.removeClass(document.body, 'loading'); 1953 mw.pauseSave = false; 1954 mw.on.DOMChangePause = false; 1955 return false; 1956 } 1957 1958 var docdata = mw.tools.parseHtml(data); 1959 1960 if(storedValues) { 1961 mw.$('[name]', docdata).each(function(){ 1962 var el = $(this); 1963 if(!el.val()) { 1964 el.val(storedValues[this.name] || undefined); 1965 this.setAttribute("value", storedValues[this.name] || ''); 1966 } 1967 }) 1968 } 1969 1970 var hasDone = typeof obj.done === 'function'; 1971 var id; 1972 if (typeof to_send.id !== 'undefined') { 1973 id = to_send.id; 1974 } else{ 1975 id = docdata.body.querySelector(['id']); 1976 } 1977 var curr = mw.$(selector); 1978 curr.after($(docdata.body).html()); 1979 1980 var _newNode = curr.next(); 1981 curr.remove() 1982 1983 1984 1985 var count = 0; 1986 if(hasDone){ 1987 setTimeout(function(){ 1988 count++; 1989 obj.done.call(_newNode[0], data); 1990 mw.trigger('moduleLoaded'); 1991 1992 if (id) { 1993 if (self !== top && top && top.mw) { 1994 1995 mw.top().app.dispatch('onModuleReloaded', id); 1996 1997 } 1998 } 1999 2000 }, 33); 2001 } 2002 2003 if(!id){ 2004 mw.pauseSave = false; 2005 mw.on.DOMChangePause = false; 2006 return false; 2007 } 2008 2009 2010 typeof mw.drag !== 'undefined' ? mw.drag.fix_placeholders(true) : ''; 2011 var m = document.getElementById(id); 2012 // typeof obj.done === 'function' ? obj.done.call(selector, m) : ''; 2013 2014 if(mw.wysiwyg){ 2015 $(m).hasClass("module") ? mw.wysiwyg.init_editables(m) : '' ; 2016 } 2017 2018 2019 if(mw.on && !hasDone){ 2020 mw.on.moduleReload(id, "", true); 2021 mw.trigger('moduleLoaded'); 2022 2023 } 2024 if($.fn.selectpicker) { 2025 $('.selectpicker').selectpicker(); 2026 } 2027 if (mw.on) { 2028 mw.on.DOMChangePause = false; 2029 } 2030 mw.tools.removeClass(document.body, 'loading'); 2031 2032 2033 }) 2034 .fail(function(){ 2035 mw.pauseSave = false; 2036 typeof obj.fail === 'function' ? obj.fail.call(selector) : ''; 2037 }) 2038 .always(function(){ 2039 mw.pauseSave = false; 2040 }); 2041 return xhr; 2042 }; 2043 2044 2045 mw.inLog = function(what) { 2046 if(!mw._inlog) { 2047 mw._inlog = document.createElement('div'); 2048 mw._inlog.className = 'mw-in-log'; 2049 $(mw._inlog).css({ 2050 position: 'fixed', 2051 bottom:0, 2052 left:0, 2053 padding:20, 2054 background:'#fff', 2055 zIndex:10, 2056 height:190, 2057 overflow:'auto', 2058 fontSize:10 2059 2060 }) 2061 document.body.appendChild(mw._inlog) 2062 } 2063 $(mw._inlog).append('<br>'+what) 2064 mw._inlog.scrollTop = mw._inlog.scrollHeight; 2065 2066 }; 2067 mw.log = function(what) { 2068 if (window.console && mw.settings.debug) { 2069 top.console.log(what); 2070 } 2071 }; 2072 2073 2074 mw.$ = function(selector, context) { 2075 if(typeof selector === 'object' || (typeof selector === 'string' && selector.indexOf('<') !== -1)){ return jQuery(selector); } 2076 context = context || mwd; 2077 if (typeof document.querySelector !== 'undefined') { 2078 if (typeof selector === 'string') { 2079 try { 2080 return jQuery(context.querySelectorAll(selector)); 2081 } catch (e) { 2082 return jQuery(selector, context); 2083 } 2084 } else { 2085 return jQuery(selector, context); 2086 } 2087 } else { 2088 return jQuery(selector, context); 2089 } 2090 }; 2091 2092 mw.get = function(action, params, callback){ 2093 var obj; 2094 var url = mw.settings.api_url + action; 2095 var type = typeof params; 2096 if(type === 'string'){ 2097 obj = mw.serializeFields(params); 2098 } 2099 else if(type.constructor === {}.constructor ){ 2100 obj = params; 2101 } 2102 else{ 2103 obj = {}; 2104 } 2105 $.post(url, obj) 2106 .success(function(data) { return typeof callback === 'function' ? callback.call(
2106data) : data; }) 2107 .error(function(data) { return typeof callback === 'function' ? callback.call(data) : data; }); 2108 } 2109 2110 get_content = function(params, callback){ 2111 var obj = mw.url.getUrlParams("?"+params); 2112 if(typeof callback!='function'){ 2113 mw.get('get_content_admin', obj); 2114 } 2115 else{ 2116 mw.get('get_content_admin', obj, function(){callback.call(this)}); 2117 } 2118 } 2119 2120 mw.get_content = get_content 2121 2122 mw.serializeFields = function(id, ignorenopost){ 2123 var ignorenopost = ignorenopost || false; 2124 var el = mw.$(id); 2125 var fields = "input[type='text'], input[type='email'], input[type='number'], input[type='tel'], " 2126 + "input[type='color'], input[type='url'], input[type='week'], input[type='search'], input[type='range'], " 2127 + "input[type='datetime-local'], input[type='month'], input[type='file'], " 2128 + "input[type='password'], input[type='hidden'], input[type='datetime'], input[type='date'], input[type='time'], " 2129 +"input[type='email'], textarea, select, input[type='checkbox']:checked, input[type='radio']:checked, " 2130 +"input[type='checkbox'][data-value-checked][data-value-unchecked]"; 2131 var data = {}; 2132 2133 $(fields, el).each(function(){ 2134 2135 if((!$(this).hasClass('no-post') || ignorenopost) && !this.disabled && this.name && typeof this.name !== 'undefined'){ 2136 var el = this, _el = $(el); 2137 var val = _el.val(); 2138 var name = el.name; 2139 2140 if (el.type === 'file' && el.files[0]) { 2141 data[name] = el.files[0]; 2142 } else if(el.name.contains("[]")){ 2143 data[name] = data[name] || [] 2144 data[name].push(val); 2145 } else if(el.type === 'checkbox' && el.getAttribute('data-value-checked') ){ 2146 data[name] = el.checked ? el.getAttribute('data-value-checked') : el.getAttribute('data-value-unchecked'); 2147 } else{ 2148 data[name] = val; 2149 } 2150 } 2151 }); 2152 return data; 2153} 2154 2155mw.response = function(form, data, messages_at_the_bottom){ 2156 messages_at_the_bottom = messages_at_the_bottom || false; 2157 if(data == null || typeof data == 'undefined' ){ 2158 return false; 2159 } 2160 2161 data = mw.tools.toJSON(data); 2162 if(typeof data === 'undefined'){ 2163 return false; 2164 } 2165 2166 if(typeof data.error !== 'undefined'){ 2167 mw._response.error(form, data, messages_at_the_bottom); 2168 return false; 2169 } 2170 else if(typeof data.success !== 'undefined'){ 2171 mw._response.success(form, data, messages_at_the_bottom); 2172 return true; 2173 } 2174 else if(typeof data.warning !== 'undefined'){ 2175 mw._response.warning(form, data, messages_at_the_bottom); 2176 return false; 2177 } 2178 else{ 2179 return false; 2180 } 2181}; 2182 2183mw._response = { 2184 error:function(form, data, _msg){ 2185 form = mw.$(form); 2186 var err_holder = mw._response.msgHolder(form, 'error'); 2187 var msg = typeof data.message !== 'undefined' ? data.message : data.error; 2188 mw._response.createHTML(msg, err_holder); 2189 }, 2190 success:function(form, data, _msg){ 2191 form = mw.$(form); 2192 var err_holder = mw._response.msgHolder(form, 'success'); 2193 var msg = typeof data.message !== 'undefined' ? data.message : data.success; 2194 mw._response.createHTML(msg, err_holder); 2195 }, 2196 warning:function(form, data, _msg){ 2197 form = mw.$(form); 2198 var err_holder = mw._response.msgHolder(form, 'warning'); 2199 var msg = typeof data.message !== 'undefined' ? data.message : data.warning; 2200 mw._response.createHTML(msg, err_holder); 2201 }, 2202 msgHolder : function(form, type, method){ 2203 method = method || 'append'; 2204 var err_holder = form.find(".mw-checkout-response:first"); 2205 var err_holder2 = form.find(".alert:first"); 2206 if(err_holder.length === 0){ 2207 err_holder = err_holder2; 2208 } 2209 if(err_holder.length === 0){ 2210 err_holder = document.createElement('div'); 2211 form[method](err_holder); 2212 } 2213 2214 var bootrap_error_type = 'default'; 2215 if(type === 'error'){ 2216 bootrap_error_type = 'danger'; 2217 } else if(type === 'done'){ 2218 bootrap_error_type = 'info'; 2219 } 2220 2221 2222 $(err_holder).empty().attr("class", 'alert alert-' + type + ' alert-' + bootrap_error_type + ' '); 2223 return err_holder; 2224 }, 2225 createHTML:function(data, holder){ 2226 var i, html = ""; 2227 2228 2229 if(typeof data === 'string'){ 2230 html+= data.toString(); 2231 } 2232 else{ 2233 for( i in data){ 2234 if(typeof data[i] === 'string'){ 2235 html+='<li>'+data[i]+'</li>'; 2236 } 2237 else if(typeof data[i] === 'object'){ 2238 $.each(data[i], function(){ 2239 html+='<li>'+this+'</li>'; 2240 }) 2241 } 2242 } 2243 } 2244 mw.$(holder).eq(0).append('<ul class="mw-error-list">'+html+'</ul>'); 2245 mw.$(holder).eq(0).show(); 2246 } 2247} 2248 2249 2250mw.user = { 2251 isLogged:function(callback){ 2252 $.post(mw.settings.api_url + 'is_logged', function(data){ 2253 var isLogged = (data === 'true'); 2254 callback.call(isLogged, isLogged); 2255 }); 2256 } 2257}; 2258 2259mw.parent = function(){ 2260 if(window === top){ 2261 return window.mw; 2262 } 2263 if(mw.tools.canAccessWindow(parent) && parent.mw){ 2264 return parent.mw; 2265 } 2266 return window.mw; 2267}; 2268 2269mw.top = function(){ 2270 if(!!mw.__top){ 2271 return mw.__top; 2272 } 2273 var getLastParent = function() { 2274 var result = window; 2275 var curr = window; 2276 while (curr && mw.tools.canAccessWindow(curr) && (curr.mw || curr.parent.mw)){ 2277 result = curr; 2278 curr = curr.parent; 2279 } 2280 mw.__top = result.mw; 2281 return result.mw; 2282 }; 2283 if(window === top){ 2284 mw.__top = window.mw; 2285 return window.mw; 2286 } else { 2287 if(mw.tools.canAccessWindow(top) && top.mw){ 2288 mw.__top = top.mw; 2289 return top.mw; 2290 } else{ 2291 if(window.top !== window.parent){ 2292 return getLastParent(); 2293 } 2294 else{ 2295 mw.__top = window.mw; 2296 return window.mw; 2297 } 2298 } 2299 } 2300}; 2301 2302 2303 2304 2305mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/jquery.js"); 2306 2307 2308 2309mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools.js"); 2310mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/cookie.js"); 2311 2312 2313 2314mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/forms.js"); 2315 2316mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/url.js"); 2317 2318mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/events.js"); 2319 2320//mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/upgrades.js"); 2321mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/session.js"); 2322 2323mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/shop.js"); 2324 2325mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/common.js"); 2326 2327mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/components.js"); 2328 2329mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/dialog.js"); 2330mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/instruments.js"); 2331mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/forms.js"); 2332mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/fonts.js"); 2333mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/animations.js"); 2334mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/background_videos.js"); 2335 2336//mw.required.push("https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/content.js"); 2337 2338 2339 2340 2341 2342mw.tools = {}; 2343 2344 2345 2346mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/base64.js'); 2347 2348mw.tools.base64 = { 2349// private property 2350 _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2350+/=", 2351// public method for encoding 2352 encode: function (input) { 2353 var output = ""; 2354 var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 2355 var i = 0; 2356 input = mw.tools.base64._utf8_encode(input); 2357 while (i < input.length) { 2358 chr1 = input.charCodeAt(i++); 2359 chr2 = input.charCodeAt(i++); 2360 chr3 = input.charCodeAt(i++); 2361 enc1 = chr1 >> 2; 2362 enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 2363 enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 2364 enc4 = chr3 & 63; 2365 if (isNaN(chr2)) { 2366 enc3 = enc4 = 64; 2367 } else if (isNaN(chr3)) { 2368 enc4 = 64; 2369 } 2370 output = output + 2371 this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + 2372 this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); 2373 } 2374 return output; 2375 }, 2376// public method for decoding 2377 decode: function (input) { 2378 if (typeof input == 'undefined') { 2379 return; 2380 } 2381 var output = ""; 2382 var chr1, chr2, chr3; 2383 var enc1, enc2, enc3, enc4; 2384 var i = 0; 2385 input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 2386 while (i < input.length) { 2387 enc1 = this._keyStr.indexOf(input.charAt(i++)); 2388 enc2 = this._keyStr.indexOf(input.charAt(i++)); 2389 enc3 = this._keyStr.indexOf(input.charAt(i++)); 2390 enc4 = this._keyStr.indexOf(input.charAt(i++)); 2391 chr1 = (enc1 << 2) | (enc2 >> 4); 2392 chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 2393 chr3 = ((enc3 & 3) << 6) | enc4; 2394 output = output + String.fromCharCode(chr1); 2395 if (enc3 != 64) { 2396 output = output + String.fromCharCode(chr2); 2397 } 2398 if (enc4 != 64) { 2399 output = output + String.fromCharCode(chr3); 2400 } 2401 } 2402 output = mw.tools.base64._utf8_decode(output); 2403 return output; 2404 }, 2405// private method for UTF-8 encoding 2406 _utf8_encode: function (string) { 2407 string = string.replace(/\r\n/g, "\n"); 2408 var utftext = ""; 2409 for (var n = 0; n < string.length; n++) { 2410 var c = string.charCodeAt(n); 2411 if (c < 128) { 2412 utftext += String.fromCharCode(c); 2413 } 2414 else if ((c > 127) && (c < 2048)) { 2415 utftext += String.fromCharCode((c >> 6) | 192); 2416 utftext += String.fromCharCode((c & 63) | 128); 2417 } 2418 else { 2419 utftext += String.fromCharCode((c >> 12) | 224); 2420 utftext += String.fromCharCode(((c >> 6) & 63) | 128); 2421 utftext += String.fromCharCode((c & 63) | 128); 2422 } 2423 } 2424 return utftext; 2425 }, 2426// private method for UTF-8 decoding 2427 _utf8_decode: function (utftext) { 2428 var string = ""; 2429 var i = 0; 2430 var c = c1 = c2 = 0; 2431 while (i < utftext.length) { 2432 c = utftext.charCodeAt(i); 2433 if (c < 128) { 2434 string += String.fromCharCode(c); 2435 i++; 2436 } 2437 else if ((c > 191) && (c < 224)) { 2438 c2 = utftext.charCodeAt(i + 1); 2439 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 2440 i += 2; 2441 } 2442 else { 2443 c2 = utftext.charCodeAt(i + 1); 2444 c3 = utftext.charCodeAt(i + 2); 2445 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 2446 i += 3; 2447 } 2448 } 2449 return string; 2450 } 2451} 2452 2453mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/checkbox.js'); 2454 2455mw.check = { 2456 all: function (selector) { 2457 mw.$(selector).find("input[type='checkbox']").each(function () { 2458 this.checked = true; 2459 }); 2460 }, 2461 none: function (selector) { 2462 mw.$(selector).find("input[type='checkbox']").each(function () { 2463 this.checked = false; 2464 }); 2465 }, 2466 toggle: function (selector) { 2467 var els = mw.$(selector).find("input[type='checkbox']"), checked = els.filter(':checked'); 2468 if (els.length === checked.length) { 2469 mw.check.none(selector) 2470 } 2471 else { 2472 mw.check.all(selector); 2473 } 2474 }, 2475 collectChecked: function (parent) { 2476 var arr = []; 2477 var all = parent.querySelectorAll('input[type="checkbox"]'), i = 0, l = all.length; 2478 for (; i < l; i++) { 2479 var el = all[i]; 2480 el.checked ? arr.push(el.value) : ''; 2481 } 2482 return arr; 2483 } 2484} 2485 2486mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/colorpicker.js'); 2487 2488;(function () { 2489 mw._colorPickerDefaults = { 2490 skin: 'mw-tooltip-default', 2491 position: 'bottom-center', 2492 onchange: false 2493 }; 2494 2495 2496 var _isValidColorTest = new Option(); 2497 var isValidColor = (color) => { 2498 _isValidColorTest.style.color = ''; 2499 _isValidColorTest.style.color = color; 2500 return _isValidColorTest.style.color !== ''; 2501 } 2502 2503 var colorPickers = []; 2504 2505 mw._colorPicker = function (options) { 2506 mw.lib.require('colorpicker'); 2507 2508 if (!mw.tools.colorPickerColors) { 2509 mw.tools.colorPickerColors = []; 2510 2511 2512 2513 if (typeof mw.top().app !== 'undefined' 2514 && typeof mw.top().app.templateSettings !== 'undefined' 2515 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2516 2517 var colorsFromPallete = mw.top().app.templateSettings.colorPaletteManager.getColors(); 2518 2519 if (colorsFromPallete.length > 0) { 2520 colorsFromPallete.forEach(function (color) { 2521 if (mw.tools.colorPickerColors.indexOf(color) === -1) { 2522 mw.tools.colorPickerColors.push(color); 2523 } 2524 }); 2525 } 2526 } else if (typeof mw.color !== 'undefined' && typeof mw.color.rgbToHex !== 'undefined') { 2527 2528 //legacy mode 2529 2530 var colorpicker_els = mw.top().$(".btn,h1,h2,h3,h4,h5"); 2531 if (colorpicker_els.length > 0) { 2532 colorpicker_els.each(function () { 2533 var css = parent.getComputedStyle(this, null); 2534 if (css !== null) { 2535 if (mw.tools.colorPickerColors.indexOf(css.color) === -1) { 2536 mw.tools.colorPickerColors.push(mw.color.rgbToHex(css.color)); 2537 } 2538 if (mw.tools.colorPickerColors.indexOf(css.backgroundColor) === -1) { 2539 mw.tools.colorPickerColors.push(mw.color.rgbToHex(css.backgroundColor)); 2540 } 2541 } 2542 }); 2543 } 2544 } 2545 2546 2547 2548 2549 } 2550 var proto = this; 2551 if (!options) { 2552 return false;
2553 } 2554 2555 var settings = $.extend({}, mw._colorPickerDefaults, options); 2556 2557 if (settings.element === undefined || settings.element === null) { 2558 return false; 2559 } 2560 2561 2562 var $el = mw.$(settings.element); 2563 if ($el[0] === undefined) { 2564 return false; 2565 } 2566 if ($el[0].mwcolorPicker) { 2567 return $el[0].mwcolorPicker; 2568 } 2569 2570 2571 $el[0].mwcolorPicker = this; 2572 this.element = $el[0]; 2573 if ($el[0].mwToolTipBinded !== undefined) { 2574 return false; 2575 } 2576 if (!settings.method) { 2577 if (this.element.nodeName === 'DIV') { 2578 settings.method = 'inline'; 2579 } 2580 } 2581 this.settings = settings; 2582 2583 $el[0].mwToolTipBinded = true; 2584 2585 2586 var sett = { 2587 showAlpha: true, 2588 showHSL: false, 2589 showRGB: false, 2590 showHEX: true, 2591 // paletteEditable: true, 2592 palette: mw.tools.colorPickerColors 2593 }; 2594 2595 2596 2597 if (typeof mw.top().app !== 'undefined' 2598 && typeof mw.top().app.templateSettings !== 'undefined' 2599 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2600 2601 var colorsFromPallete = mw.top().app.templateSettings.colorPaletteManager.getColors(); 2602 2603 if (colorsFromPallete.length > 0) { 2604 colorsFromPallete.forEach(function (color) { 2605 if (mw.tools.colorPickerColors.indexOf(color) === -1) { 2606 mw.tools.colorPickerColors.push(color); 2607 } 2608 }); 2609 } 2610 sett.palette = mw.tools.colorPickerColors; 2611 sett.paletteEditable = true; 2612 } 2613 2614 2615 2616 2617 2618 2619 if (settings.value) { 2620 sett.color = settings.value; 2621 2622 } 2623 if (typeof settings.showRGB !== 'undefined') { 2624 sett.showRGB = settings.showRGB 2625 } 2626 if (typeof settings.showHEX !== 'undefined') { 2627 sett.showHEX = settings.showHEX 2628 } 2629 2630 if (typeof settings.showHSL !== 'undefined') { 2631 sett.showHSL = settings.showHSL 2632 } 2633 var frame; 2634 this.setColor = function (color) { 2635 frame.setColor(color) 2636 }; 2637 if (settings.method === 'inline') { 2638 2639 sett.attachTo = $el[0]; 2640 2641 2642 frame = sett.attachTo.ownerDocument.defaultView.AColorPicker.createPicker(sett); // AColorPicker works only with local window 2643 frame.on('coloradd', (picker, color) => { 2644 if (typeof mw.top().app !== 'undefined' 2645 && typeof mw.top().app.templateSettings !== 'undefined' 2646 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2647 mw.top().app.templateSettings.colorPaletteManager.addToPaletteMemory(color); 2648 } 2649 }); 2650 frame.on('colorremove', (picker, color) => { 2651 if (typeof mw.top().app !== 'undefined' 2652 && typeof mw.top().app.templateSettings !== 'undefined' 2653 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2654 mw.top().app.templateSettings.colorPaletteManager.removeFromPaletteMemory(color); 2655 } 2656 }); 2657 2658 frame.onchange = function (data) { 2659 2660 if (proto.settings.onchange) { 2661 proto.settings.onchange(data.color); 2662 } 2663 2664 if ($el[0].nodeName === 'INPUT') { 2665 var val = val === 'transparent' ? val : '#' + val; 2666 $el.val(val); 2667 var prev = $el[0].previousElementSibling 2668 if (prev && prev.classList.contains('mw-field-color-indicator')) { 2669 var dp = prev.querySelector('.mw-field-color-indicator-display') 2670 if (dp) { 2671 dp.style.backgroundColor = val 2672 } 2673 } 2674 } 2675 } 2676 2677 2678 2679 } else { 2680 var tip = mw.tooltip(settings), $tip = mw.$(tip).hide(); 2681 2682 colorPickers.push(tip) 2683 this.tip = tip; 2684 2685 mw.$('.mw-tooltip-content', tip).empty().css({ 2686 padding: 0 2687 }); 2688 sett.attachTo = mw.$('.mw-tooltip-content', tip)[0] 2689 2690 frame = AColorPicker.createPicker(sett); 2691 2692 2693 frame.on('coloradd', (picker, color) => { 2694 if (typeof mw.top().app !== 'undefined' 2695 && typeof mw.top().app.templateSettings !== 'undefined' 2696 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2697 mw.top().app.templateSettings.colorPaletteManager.addToPaletteMemory(color); 2698 } 2699 }); 2700 frame.on('colorremove', (picker, color) => { 2701 if (typeof mw.top().app !== 'undefined' 2702 && typeof mw.top().app.templateSettings !== 'undefined' 2703 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2704 mw.top().app.templateSettings.colorPaletteManager.removeFromPaletteMemory(color); 2705 } 2706 }); 2707 2708 2709 2710 frame.onchange = function (data) { 2711 2712 if (frame.pause) { 2713 return; 2714 } 2715 2716 if (proto.settings.onchange) { 2717 proto.settings.onchange(data.color); 2718 } 2719 2720 if ($el[0].nodeName === 'INPUT') { 2721 $el.val(data.color); 2722 var prev = $el[0].previousElementSibling 2723 if (prev && prev.classList.contains('mw-field-color-indicator')) { 2724 var dp = prev.querySelector('.mw-field-color-indicator-display'); 2725 if (dp) { 2726 dp.style.backgroundColor = data.color 2727 } 2728 2729 } 2730 } 2731 }; 2732 if ($el[0].nodeName === 'INPUT') { 2733 $el.on('input', function (e) { 2734 var val = this.value.trim(); 2735 if (!val) { 2736 val = 'transparent'; 2737 } 2738 if (isValidColor(val)) { 2739 var prev = $el[0].previousElementSibling 2740 if (prev && prev.classList.contains('mw-field-color-indicator')) { 2741 var dp = prev.querySelector('.mw-field-color-indicator-display') 2742 if (dp) { 2743 dp.style.backgroundColor = val 2744 } 2745 } 2746 if (proto.settings.onchange) { 2747 proto.settings.onchange(val); 2748 } 2749 } 2750 }); 2751 $el.on('focus', function (e) { 2752 if (this.value.trim()) { 2753 frame.pause = true; 2754 frame.color = this.value; 2755 setTimeout(function () { 2756 frame.pause = false;
2757 }); 2758 } 2759 colorPickers.forEach(function (clpckr) { 2760 2761 if (clpckr !== tip) { 2762 mw.$(clpckr).hide(); 2763 } 2764 }); 2765 mw.$(tip).show(); 2766 mw.tools.tooltip.setPosition(tip, $el[0], settings.position) 2767 2768 }); 2769 } else { 2770 $el.on('click', function (e) { 2771 colorPickers.forEach(function (clpckr) { 2772 2773 if (clpckr !== tip) { 2774 mw.$(clpckr).hide(); 2775 } 2776 }); 2777 mw.$(tip).toggle(); 2778 mw.tools.tooltip.setPosition(tip, $el[0], settings.position); 2779 }); 2780 } 2781 var documents = [document]; 2782 if (self !== mw.top().win) { 2783 documents.push(mw.top().win.document); 2784 } 2785 2786 2787 $el.addClass('mw-color-picker-field') 2788 2789 } 2790 2791 2792 if (frame && frame.element) { 2793 //append remove color 2794 var frameEl = $(frame.element).find('.a-color-picker-palette').first()[0]; 2795 var removeColorButton = mw.element('<div class="a-color-picker-palette-color color-picker-palette-color-transparent" style="background-image: repeating-conic-gradient(silver 0 25%, transparent 0 50%);background-size: 9px 9px;"></div>') 2796 removeColorButton.on('click', function (e) { 2797 e.stopPropagation() 2798 if (proto.settings.onchange) { 2799 proto.settings.onchange('rgb(0 0 0 / 0%)'); 2800 } 2801 }); 2802 2803 var resetColorButton = mw.element(` 2804 <div 2805 class="a-color-picker-palette-color color-picker-palette-color-reset"></div> 2806 `) 2807 resetColorButton.on('click', function (e) { 2808 2809 2810 e.stopPropagation() 2811 if (proto.settings.onchange) { 2812 proto.settings.onchange('revert-layer'); 2813 } 2814 }); 2815 2816 2817 frameEl.append(removeColorButton.get(0)) 2818 frameEl.append(resetColorButton.get(0)) 2819 2820 2821 2822 2823 if (typeof mw.top().app !== 'undefined' 2824 && typeof mw.top().app.templateSettings !== 'undefined' 2825 && typeof mw.top().app.templateSettings.colorPaletteManager !== 'undefined') { 2826 if (proto.settings.value) { 2827 var inMemory = mw.top().app.templateSettings.colorPaletteManager.isInPaletteMemory(proto.settings.value); 2828 if(inMemory) { 2829 var removeColorFromMemory = mw.element(` 2830 <div 2831 class="a-color-picker-palette-color color-picker-palette-color-remove-from-palette"></div> 2832 `) 2833 removeColorFromMemory.on('click', function (e) { 2834 e.stopPropagation() 2835 if (proto.settings.value) { 2836 var color = proto.settings.value; 2837 2838 mw.top().app.templateSettings.colorPaletteManager.removeFromPaletteMemory(color); 2839 2840 if (proto.settings.onchange) { 2841 proto.settings.onchange('revert-layer'); 2842 } 2843 } 2844 2845 }); 2846 frameEl.append(removeColorFromMemory.get(0)); 2847 2848 2849 } 2850 } 2851 } 2852 2853 } 2854 2855 2856 2857 if (this.tip) { 2858 this.show = function () { 2859 mw.$(this.tip).show(); 2860 mw.tools.tooltip.setPosition(this.tip, this.settings.element, this.settings.position) 2861 }; 2862 this.hide = function () { 2863 mw.$(this.tip).hide(); 2864 }; 2865 this.toggle = function () { 2866 var tip = mw.$(this.tip); 2867 if (tip.is(':visible')) { 2868 this.hide(); 2869 } else { 2870 $el.focus(); 2871 this.show(); 2872 } 2873 } 2874 } 2875 var prev = $el[0].previousElementSibling 2876 if (prev && prev.classList.contains('mw-field-color-indicator')) { 2877 var dp = prev.querySelector('.mw-field-color-indicator-display') 2878 if (dp) { 2879 dp.style.backgroundColor = $el[0].value 2880 } 2881 } 2882 2883 }; 2884 mw.colorPicker = function (o) { 2885 2886 return new mw._colorPicker(o); 2887 }; 2888 2889 $(document).ready(function () { 2890 $(document).on('click', function (e) { 2891 if (!mw.tools.hasParentsWithClass(e.target, 'a-color-picker') && !mw.tools.hasClass(e.target, 'mw-color-picker-field')) {
2892 colorPickers.forEach(function (clpckr) { 2893 2894 mw.$(clpckr).hide(); 2895 2896 }); 2897 } 2898 2899 }) 2900 }) 2901 2902})(); 2903 2904 2905mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/common-extend.js'); 2906 2907mw.requestAnimationFrame = (function () { 2908 return window.webkitRequestAnimationFrame || 2909 window.mozRequestAnimationFrame || 2910 window.oRequestAnimationFrame || 2911 window.msRequestAnimationFrame || 2912 function (callback, element) { 2913 window.setTimeout(callback, 1000 / 60); 2914 }; 2915})(); 2916 2917mw._intervals = {}; 2918mw.interval = function(key, func){ 2919 if(!key || !func || !!mw._intervals[key]) return; 2920 mw._intervals[key] = func; 2921}; 2922mw.removeInterval = function(key){ 2923 delete mw._intervals[key]; 2924}; 2925setInterval(function(){ 2926 for(var i in mw._intervals){ 2927 mw._intervals[i].call(); 2928 } 2929}, 99); 2930 2931mw.datassetSupport = typeof document.documentElement.dataset !== 'undefined'; 2932 2933mw.exec = function (str, a, b, c) { 2934 a = a || ""; 2935 b = b || ""; 2936 c = c || ""; 2937 if (!str.contains(".")) { 2938 return window[this](a, b, c); 2939 } 2940 else { 2941 var arr = str.split("."); 2942 var temp = window[arr[0]]; 2943 var len = arr.length - 1; 2944 for (var i = 1; i <= len; i++) { 2945 if (typeof temp === 'undefined') { 2946 return false; 2947 } 2948 temp = temp[arr[i]]; 2949 } 2950 return mw.is.func(temp) ? temp(a, b, c) : temp; 2951 } 2952}; 2953 2954mw.controllers = {}; 2955mw.external_tool = function (url) { 2956 return !url.contains("/") ? mw.settings.site_url + "editor_tools/" + url : url; 2957}; 2958// Polyfill for escape/unescape 2959if (!window.unescape) { 2960 window.unescape = function (s) { 2961 return s.replace(/%([0-9A-F]{2})/g, function (m, p) { 2962 return String.fromCharCode('0x' + p); 2963 }); 2964 }; 2965} 2966if (!window.escape) { 2967 window.escape = function (s) { 2968 var chr, hex, i = 0, l = s.length, out = ''; 2969 for (; i < l; i++) { 2970 chr = s.charAt(i); 2971 if (chr.search(/[A-Za-z0-9\@\*\_\+\-\.\/]/) > -1) { 2972 out += chr; 2973 continue; 2974 } 2975 hex = s.charCodeAt(i).toString(16); 2976 out += '%' + ( hex.length % 2 !== 0 ? '0' : '' ) + hex; 2977 } 2978 return out; 2979 }; 2980} 2981 2982 2983Array.prototype.remove = Array.prototype.remove || function (what) { 2984 var i = 0, l = this.length; 2985 for ( ; i < l; i++) { 2986 this[i] === what ? this.splice(i, 1) : ''; 2987 } 2988}; 2989 2990mw.which = function (str, arr_obj, func) { 2991 if (arr_obj instanceof Array) { 2992 var l = arr_obj.length, i = 0; 2993 for (; i < l; i++) { 2994 if (arr_obj[i] === str) { 2995 func.call(arr_obj[i]); 2996 return arr_obj[i]; 2997 } 2998 } 2999 } 3000 else { 3001 for (var i in arr_obj) { 3002 if (i === str) { 3003 func.call(arr_obj[i]); 3004 return arr_obj[i]; 3005 } 3006 } 3007 } 3008}; 3009 3010 3011 3012mw._JSPrefixes = ['Moz', 'Webkit', 'O', 'ms']; 3013_Prefixtest = false; 3014mw.JSPrefix = function (property) { 3015 !_Prefixtest ? _Prefixtest = document.body.style : ''; 3016 if (_Prefixtest[property] !== undefined) { 3017 return property; 3018 } 3019 else { 3020 var property = property.charAt(0).toUpperCase() + property.slice(1), 3021 len = mw._JSPrefixes.length, 3022 i = 0; 3023 for (; i < len; i++) { 3024 if (_Prefixtest[mw._JSPrefixes[i] + property] !== undefined) { 3025 return mw._JSPrefixes[i] + property; 3026 } 3027 } 3028 } 3029} 3030if (typeof document.hidden !== "undefined") { 3031 _mwdochidden = "hidden"; 3032} else if (typeof document.mozHidden !== "undefined") { 3033 _mwdochidden = "mozHidden"; 3034} else if (typeof document.msHidden !== "undefined") { 3035 _mwdochidden = "msHidden"; 3036} else if (typeof document.webkitHidden !== "undefined") { 3037 _mwdochidden = "webkitHidden"; 3038} 3039document.isHidden = function () { 3040 if (typeof _mwdochidden !== 'undefined') { 3041 return document[_mwdochidden]; 3042 } 3043 else { 3044 return !document.hasFocus(); 3045 } 3046}; 3047 3048 3049mw.postMsg = function (w, obj) { 3050 w.postMessage(JSON.stringify(obj), window.location.href); 3051}; 3052 3053mw.uploader = function (o) { 3054 3055 mw.require("files.js"); 3056 3057 var uploader = mw.files.uploader(o); 3058 3059 return uploader; 3060}; 3061 3062mw.fileWindow = function (config) { 3063 config = config || {}; 3064 config.mode = config.mode || 'dialog'; // 'inline' | 'dialog' 3065 var q = { 3066 types: config.types, 3067 title: config.title 3068 }; 3069 3070 3071 url = mw.settings.site_url + 'editor_tools/rte_image_editor?' + $.param(q) + '#fileWindow'; 3072 var frameWindow; 3073 var toreturn = { 3074 dialog: null, 3075 root: null, 3076 iframe: null 3077 }; 3078 if (config.mode === 'dialog') { 3079 var modal = mw/*.top()*/.dialogIframe({ 3080 url: url, 3081 name: "mw_rte_image", 3082 width: 530, 3083 height: 'auto', 3084 autoHeight: true, 3085 //template: 'mw_modal_basic', 3086 overlay: true, 3087 title: mw.lang('Select image') 3088 }); 3089 var frame = mw.$('iframe', modal.main); 3090 frameWindow = frame[0].contentWindow; 3091 toreturn.dialog = modal; 3092 toreturn.root = frame.parent()[0]; 3093 toreturn.iframe = frame[0]; 3094 frameWindow.onload = function () { 3095 frameWindow.$('body').on('Result', function (e, url, m) { 3096 if (config.change) { 3097 config.change.call(undefined, url); 3098 modal.remove(); 3099 } 3100 }); 3101 $(modal).on('Result', function (e, url, m) { 3102 if (config.change) { 3103 config.change.call(undefined, url); 3104 modal.remove(); 3105 } 3106 }); 3107 }; 3108 } else if (config.mode === 'inline') { 3109 var fr = document.createElement('iframe'); 3110 fr.src = url; 3111 fr.frameBorder = 0; 3112 fr.className = 'mw-file-window-frame'; 3113 toreturn.iframe = fr; 3114 mw.tools.iframeAutoHeight(fr); 3115 if (config.element) { 3116 var $el = $(config.element); 3117 if($el.length) { 3118 toreturn.root = $el[0]; 3119 } 3120 $el.append(fr); 3121 } 3122 fr.onload = function () { 3123 this.contentWindow.$('body').on('change', function (e, url, m) { 3124 if (config.change) { 3125 config.change.call(undefined, url); 3126 } 3127 }); 3128 }; 3129 } 3130 3131 3132 return toreturn; 3133}; 3134 3135 3136 3137 3138mw.accordion = function (el, callback) { 3139 return mw.tools.accordion(mw.$(el)[0], callback); 3140}; 3141 3142 3143 3144mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/common.js'); 3145 3146$(window).load(function () { 3147 mw.loaded = true; 3148 mw.tools.addClass(document.body, 'loaded'); 3149 mw.tools.removeClass(document.body, 'loading'); 3150 mw.$('div.mw-ui-field').click(function (e) { 3151 if (e.target.type != 'text') { 3152 try { 3153 this.querySelector('input[type="text"]').focus(); 3154 } 3155 catch (e) { 3156 } 3157 } 3158 }); 3159 3160 mw.dropdown(); 3161}); 3162$(mwd).ready(function () { 3163 mw.tools.constructions(); 3164 mw.dropdown(); 3165 mw.$(document.body).ajaxStop(function () { 3166 setTimeout(function () { 3167 mw.dropdown(); 3168 }, 1222); 3169 }); 3170 mw.on('mwDialogShow', function(){ 3171 mw.$(document.documentElement).addClass('mw-dialog-opened'); 3172 }); 3173 mw.on('mwDialogHide', function(){ 3174 mw.$(document.documentElement).removeClass('mw-dialog-opened'); 3175 }); 3176 mw.$(document.body).on('mousemove touchmove touchstart', function (event) { 3177 var has = mw.tools.firstParentOrCurrentWithClass(event.target, 'tip'); 3178 if (has && (!has.dataset.trigger || has.dataset.trigger === 'move')) { 3179 mw.tools.titleTip(has); 3180 } 3181 else { 3182 mw.$(mw.tools._titleTip).hide(); 3183 } 3184 }).on('click', function (event) { 3185 var has = mw.tools.firstParentOrCurrentWithClass(event.target, 'tip'); 3186 if (has && has.dataset.trigger === 'click') { 3187 mw.tools.titleTip(has, '_titleTipClick'); 3188 } 3189 else { 3190 mw.$(mw.tools._titleTipClick).hide(); 3191 } 3192 }); 3193 mw.$(".mw-onoff").each(function () { 3194 if (!$(this).hasClass('activated')) { 3195 mw.$(this).addClass('activated'); 3196 mw.$(this).mousedown(function () { 3197 var el = this; 3198 if (mw.tools.hasClass(el, 'active')) { 3199 mw.tools.removeClass(el, 'active'); 3200 el.querySelector('.is_active_n').checked = true; 3201 } 3202 else { 3203 mw.tools.addClass(el, 'active'); 3204 el.querySelector('.is_active_y').checked = true; 3205 } 3206 }); 3207 } 3208 }); 3209 mw.$(".wysiwyg-convertible-toggler").click(function () { 3210 var el = mw.$(this), next = el.next(); 3211 mw.$(".wysiwyg-convertible").not(next).removeClass("active"); 3212 mw.$(".wysiwyg-convertible-toggler").not(el).removeClass("active"); 3213 next.toggleClass("active"); 3214 el.toggleClass("active"); 3215 if (el.hasClass("active")) { 3216 if (typeof mw.liveEditWYSIWYG === 'object') { 3217 mw.liveedit.toolbar.editor.fixConvertible(next); 3218 } 3219 } 3220 }); 3221 mw.$(".mw-dropdown-search") 3222 .on('focus', function (e) { 3223 $(this).parents('.create-content-dropdown').addClass('focus'); 3224 }) 3225 .on('blur', function (e) { 3226 $(this).parents('.create-content-dropdown').removeClass('focus'); 3227 }) 3228 .on('keyup', function (e) { 3229 if (e.keyCode === '27') { 3230 mw.$(this.parentNode.parentNode).hide(); 3231 } 3232 if (e.keyCode !== '13' && e.keyCode !== '27' && e.keyCode !== '32') { 3233 var el = mw.$(this); 3234 el.addClass('mw-dropdown-searchSearching'); 3235 mw.tools.ajaxSearch({keyword: this.value, limit: 20}, function () { 3236 var html = "<ul>", l = this.length, i = 0; 3237 for (; i < l; i++) { 3238 var a = this[i]; 3239 html += '<li class="' + a.content_type + ' ' + a.subtype + '"><a href="' + a.url + '" title="' + a.title + '">' + a.title + '</a></li>'; 3240 } 3241 html += '</ul>'; 3242 el.parent().next("ul").replaceWith(html); 3243 el.removeClass('mw-dropdown-searchSearching'); 3244 }); 3245 } 3246 }); 3247 var _mwoldww = mw.$(window).width(); 3248 mw.$(window).resize(function () { 3249 if ($(window).width() > _mwoldww) { 3250 mw.trigger("increaseWidth"); 3251 } 3252 else if ($(window).width() < _mwoldww) { 3253 mw.trigger("decreaseWidth"); 3254 } 3255 $.noop(); 3256 _mwoldww = mw.$(window).width(); 3257 }); 3258 mw.$(document.body).on("keydown", function (e) { 3259 var isgal = document.querySelector('.mw_modal_gallery') !== null; 3260 if (isgal) { 3261 if (e.keyCode === 27) { /* escape */ 3262 mw.dialog.remove(mw.$(".mw_modal_gallery")) 3263 mw.tools.cancelFullscreen() 3264 } 3265 else if (e.keyCode === 37) { /* left */ 3266 mw.tools.gallery.prev(mw.$(".mw_modal_gallery")[0].modal) 3267 } 3268 else if (e.keyCode === 39) { /* right */ 3269 mw.tools.gallery.next(mw.$(".mw_modal_gallery")[0].modal) 3270 } 3271 else if (e.keyCode === 122) {/* F11 */ 3272 mw.event.cancel(e, true); 3273 mw.tools.toggleFullscreen(mw.$(".mw_modal_gallery")[0]); 3274 return false;
3275 } 3276 } 3277 else { 3278 if (e.keyCode === 27) { 3279 var modal = mw.$(".mw_modal:last")[0]; 3280 if (modal) modal.modal.remove(); 3281 } 3282 } 3283 }); 3284 3285 mw.$(".mw-image-holder").each(function () { 3286 if ($(".mw-image-holder-overlay", this).length === 0) { 3287 mw.$('img', this).eq(0).after('<span class="mw-image-holder-overlay"></span>'); 3288 } 3289 }); 3290 3291 mw.$(".mw-ui-dropdown").on('touchstart mousedown', function(){ 3292 mw.$(this).toggleClass('active') 3293 }); 3294 mw.$(document.body).on('touchend mouseup', function(e){ 3295 if(!mw.tools.hasAnyOfClassesOnNodeOrParent(e.target, ['mw-ui-dropdown'])){ 3296 mw.$(".mw-ui-dropdown.active").removeClass('active') 3297 } 3298 }); 3299 mw.$(document.body).on('click', 'a', function(e){ 3300 3301 var target = e.target; 3302 if(target.nodeName !== 'A') { 3303 target = mw.tools.firstParentWithTag(target, 'a'); 3304 } 3305 3306 if(target && location.hash.indexOf('#mw@') !== -1 && (target.href || '').indexOf('#mw@') !== -1){ 3307 if(location.href === target.href){ 3308 var el = mw.$('#' + target.href.split('mw@')[1])[0]; 3309 if(el){ 3310 mw.tools.scrollTo(el) 3311 } 3312 } 3313 } 3314 }) 3315 3316 3317}); 3318 3319 3320mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/cookie.js'); 3321 3322mw.cookie = { 3323 get: function (name) { 3324 var cookies = document.cookie.split(";"), i = 0, l = cookies.length; 3325 for (; i < l; i++) { 3326 var x = cookies[i].substr(0, cookies[i].indexOf("=")); 3327 var y = cookies[i].substr(cookies[i].indexOf("=") + 1); 3328 x = x.replace(/^\s+|\s+$/g, ""); 3329 if (x === name) { 3330 return unescape(y); 3331 } 3332 } 3333 }, 3334 delete: function (name) { 3335 document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 3336 }, 3337 set: function (name, value, expires, path, domain, secure) { 3338 var now = new Date(); 3339 expires = expires || 365; 3340 now.setTime(now.getTime()); 3341 if (expires) { 3342 expires = expires * 1000 * 60 * 60 * 24; 3343 } 3344 var expires_date = new Date(now.getTime() + (expires)); 3345 document.cookie = name + "=" + escape(value) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : ";path=/" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); 3346 }, 3347 setEncoded: function (name, value, expires, path, domain, secure) { 3348 // value = encodeURIComponent(value); 3349 // value = escape(value); 3350 // value = mw.tools.base64.encode( unescape( encodeURIComponent( value ) ) ) 3351 value = mw.tools.base64.encode(value); 3352 return this.set(name, value, expires, path, domain, secure); 3353 }, 3354 getEncoded: function (name) { 3355 var value = this.get(name); 3356 // value = decodeURIComponent(value); 3357 // value = unescape(value); 3358 // value = decodeURIComponent( escape( mw.tools.base64.decode( value ) ) ) 3359 value = mw.tools.base64.decode(value); 3360 return value; 3361 }, 3362 ui: function (a, b) { 3363 var mwui = mw.cookie.getEncoded("mwui"); 3364 try { 3365 mwui = (!mwui || mwui === '') ? {} : $.parseJSON(mwui); 3366 } 3367 catch (e) { 3368 return false; 3369 } 3370 if (typeof a === 'undefined') { 3371 return mwui; 3372 } 3373 if (typeof b === 'undefined') { 3374 return mwui[a] !== undefined ? mwui[a] : ""; 3375 } 3376 else { 3377 mwui[a] = b; 3378 var tostring = JSON.stringify(mwui); 3379 mw.cookie.setEncoded("mwui", tostring, false, "/"); 3380 if (typeof mw.cookie.uievents[a] !== 'undefined') { 3381 var funcs = mw.cookie.uievents[a], l = funcs.length, i = 0; 3382 for (; i < l; i++) { 3383 mw.cookie.uievents[a][i].call(b.toString()); 3384 } 3385 } 3386 } 3387 }, 3388 uievents: {}, 3389 changeInterval: null, 3390 uiCurr: null, 3391 onchange: function (name, func) { 3392 if (typeof mw.cookie.uievents[name] === 'undefined') { 3393 mw.cookie.uievents[name] = [func]; 3394 } 3395 else { 3396 mw.cookie.uievents[name].push(func); 3397 } 3398 } 3399}; 3400 3401 3402mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/dialog.js'); 3403 3404(function (mw) { 3405 3406 mw.dialog = function (options) { 3407 return new mw.Dialog(options); 3408 }; 3409 3410 mw.dialogIframe = function (options, cres) { 3411 options.pauseInit = true; 3412 var attr = 'frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; display-capture" allowfullscreen'; 3413 if (options.autoHeight) { 3414 // attr += ' scrolling="no"'; 3415 options.height = 'auto'; 3416 } 3417 options.content = '<iframe src="' + mw.external_tool(options.url.trim()) + '" ' + attr + '></iframe>'; 3418 options.className = ('mw-dialog-iframe mw-dialog-iframe-loading ' + (options.className || '')).trim(); 3419 options.className += (options.autoHeight ? ' mw-dialog-iframe-autoheight' : ''); 3420 var dialog = new mw.Dialog(options, cres); 3421 dialog.iframe = dialog.dialogContainer.querySelector('iframe'); 3422 mw.tools.loading(dialog.dialogContainer, 90); 3423 dialog.dialogContainer.style.minHeight = '100px'; 3424 mw.spinner({element: dialog.dialogContainer, size: 32, decorate: true}).show(); 3425 3426 3427 if(options && options.id){ 3428 dialog.iframe.id = options.id+'-content-window'; 3429 } 3430 3431 3432 var maxHeight = 'calc(100vh - 140px)'; 3433 3434 3435 setTimeout(function () { 3436 var frame = dialog.dialogContainer.querySelector('iframe'); 3437 frame.style.minHeight = 0; // reset in case of conflicts 3438 frame.loading = 'lazy'; 3439 3440 if (options.autoHeight) { 3441 mw.tools.iframeAutoHeight(frame, {dialog: dialog, maxHeightWindowScroll: maxHeight}); 3442 } else{ 3443 $(frame).height(options.height - 60); 3444 frame.style.position = 'relative'; 3445 frame.style.maxHeight = maxHeight; 3446 } 3447 mw.$(frame).on('load', function () { 3448 mw.tools.loading(dialog.dialogContainer, false); 3449 mw.spinner({element: dialog.dialogContainer, size: 32, decorate: true}).remove(); 3450 setTimeout(function () { 3451 dialog.center(); 3452 mw.$(frame).on('bodyResize', function () { 3453 dialog.center(); 3454 }); 3455 dialog.dialogMain.classList.remove('mw-dialog-iframe-loading'); 3456 3457 3458 if (mw.tools.canAccessIFrame(frame)) { 3459 if(frame && frame.contentWindow && frame.contentWindow.thismodal) { 3460 frame.contentWindow.thismodal = dialog; 3461 if (options.autoHeight) { 3462 mw.tools.iframeAutoHeight(frame, {dialog: dialog, maxHeightWindowScroll: maxHeight}); 3463 } 3464 } 3465 } 3466 3467 }, 78); 3468 if (mw.tools.canAccessIFrame(frame)) { 3469 mw.$(frame.contentWindow.document).on('keydown', function (e) { 3470 if (mw.event.is.escape(e) && !mw.event.targetIsField(e)) { 3471 if(mw.top().__dialogs && mw.top().__dialogs.length){ 3472 var dlg = mw.top().__dialogs; 3473 dlg[dlg.length - 1]._doCloseButton(); 3474 $(dlg[dlg.length - 1]).trigger('closedByUser'); 3475 } 3476 else { 3477 if (dialog.options.closeOnEscape) { 3478 dialog._doCloseButton(); 3479 $(dialog).trigger('closedByUser'); 3480 } 3481 } 3482 } 3483 }); 3484 } 3485 if(typeof options.onload === 'function') { 3486 options.onload.call(dialog); 3487 } 3488 }); 3489 }, 12); 3490 return dialog; 3491 }; 3492 3493 /** @deprecated */ 3494 mw.modal = mw.dialog; 3495 mw.modalFrame = mw.dialogIframe; 3496 3497 mw.dialog.remove = function (selector) { 3498 var dlg = mw.dialog.get(selector); 3499 if(dlg) { 3500 dlg.remove() 3501 } 3502 }; 3503 3504 mw.dialog.get = function (selector) { 3505 selector = selector || '.mw-dialog'; 3506 var $el = mw.$(selector); 3507 var el = $el[0]; 3508 3509 if(!el) return false;
3510 3511 if(el._dialog) { 3512 return el._dialog; 3513 } 3514 var child_cont = el.querySelector('.mw-dialog-holder'); 3515 var parent_cont = $el.parents(".mw-dialog-holder:first"); 3516 if (child_cont) { 3517 return child_cont._dialog; 3518 } 3519 else if (parent_cont.length !== 0) { 3520 return parent_cont[0]._dialog; 3521 } 3522 else if (window.thismodal) { 3523 return thismodal; 3524 } 3525 else { 3526 // deprecated 3527 child_cont = el.querySelector('.mw_modal'); 3528 parent_cont = $el.parents(".mw_modal:first"); 3529 if(child_cont) { 3530 return child_cont.modal; 3531 } else if (parent_cont.length !== 0) { 3532 return parent_cont[0].modal; 3533 } 3534 return false; 3535 } 3536 }; 3537 3538 3539 mw.Dialog = function (options, cres) { 3540 3541 var scope = this; 3542 3543 options = options || {}; 3544 options.content = options.content || options.html || ''; 3545 3546 if(!options.height && typeof options.autoHeight === 'undefined') { 3547 options.height = 'auto'; 3548 options.autoHeight = true; 3549 } 3550 3551 var defaults = { 3552 skin: 'default', 3553 overlay: true, 3554 overlayClose: false, 3555 autoCenter: true, 3556 root: document, 3557 id: options.name || options.id || mw.id('mw-dialog-'), 3558 content: '', 3559 closeOnEscape: true, 3560 closeButton: true, 3561 closeButtonAppendTo: '.mw-dialog-header', 3562 closeButtonAction: 'remove', // 'remove' | 'hide' 3563 draggable: true, 3564 scrollMode: 'inside', // 'inside' | 'window', 3565 centerMode: 'intuitive', // 'intuitive' | 'center' 3566 containment: 'window', 3567 overflowMode: 'auto', // 'auto' | 'hidden' | 'visible' 3568 disableTextSelection: false, 3569 3570 }; 3571 3572 this.options = $.extend({}, defaults, options, { 3573 // skin: 'default' 3574 }); 3575 3576 3577 this.id = this.options.id; 3578 3579 3580 var exist = document.getElementById(this.id); 3581 if (exist) { 3582 return exist._dialog; 3583 } 3584 3585 this.hasBeenCreated = function () { 3586 return this.options.root.getElementById(this.id) !== null; 3587 }; 3588 3589 if (this.hasBeenCreated()) { 3590 return this.options.root.getElementById(this.id)._dialog; 3591 } 3592 3593 if(!mw.top().__dialogs ) { 3594 mw.top().__dialogs = []; 3595 } 3596 if (!mw.top().__dialogsData) { 3597 mw.top().__dialogsData = {}; 3598 } 3599 3600 3601 if (!mw.top().__dialogsData._esc) { 3602 mw.top().__dialogsData._esc = true; 3603 mw.$(document).on('keydown', function (e) { 3604 if (mw.event.is.escape(e)) { 3605 var dlg = mw.top().__dialogs[mw.top().__dialogs.length - 1]; 3606 if (dlg && dlg.options && dlg.options.closeOnEscape) { 3607 dlg._doCloseButton(); 3608 } 3609 } 3610 }); 3611 } 3612 3613 mw.top().__dialogs.push(this); 3614 3615 this.draggable = function () { 3616 if (this.options.draggable && $.fn.draggable) { 3617 var $holder = mw.$(this.dialogHolder); 3618 $holder.draggable({ 3619 handle: this.options.draggableHandle || '.mw-dialog-header', 3620 start: function () { 3621 $holder.addClass('mw-dialog-drag-start'); 3622 scope._dragged = true; 3623 }, 3624 stop: function () { 3625 $holder.removeClass('mw-dialog-drag-start'); 3626 }, 3627 containment: scope.options.containment, 3628 scroll: false, 3629 iframeFix: true 3630 }); 3631 } 3632 }; 3633 3634 this.header = function () { 3635 this.dialogHeader = this.options.root.createElement('div'); 3636 this.dialogHeader.className = 'mw-dialog-header'; 3637 if (this.options.title || this.options.header) { 3638 this.dialogHeader.innerHTML = '<div class="modal-title settings-title-inside">' + (this.options.title || this.options.header) + '</div>'; 3639 } 3640 }; 3641 3642 this.footer = function (content) { 3643 this.dialogFooter = this.options.root.createElement('div'); 3644 this.dialogFooter.className = 'mw-dialog-footer'; 3645 if (this.options.footer) { 3646 $(this.dialogFooter).append(this.options.footer); 3647 } 3648 }; 3649 3650 this.title = function (title) { 3651 var root = mw.$('.mw-dialog-title', this.dialogHeader); 3652 if (typeof title === 'undefined') { 3653 return root.html(); 3654 } else { 3655 if (root[0]) { 3656 root.html(title); 3657 } 3658 else { 3659 mw.$(this.dialogHeader).prepend('<div class="modal-title settings-title-inside">' + title + '</div>'); } 3660 } 3661 }; 3662 3663 3664 this.build = function () { 3665 this.dialogMain = this.options.root.createElement('div'); 3666 if (this.options.disableTextSelection){ 3667 this.dialogMain.style.userSelect = 'none'; 3668 } 3669 this.dialogMain.id = this.id; 3670 var cls = 'mw-dialog mw-dialog-scroll-mode-' + this.options.scrollMode 3671 + ' mw-dialog-skin-' + this.options.skin 3672 + ' mw-dialog-overflowMode-' + this.options.overflowMode; 3673 cls += (!this.options.className ? '' : (' ' + this.options.className)); 3674 this.dialogMain.className = cls; 3675 this.dialogMain._dialog = this; 3676 3677 this.dialogHolder = this.options.root.createElement('div'); 3678 this.dialogHolder.id = 'mw-dialog-holder-' + this.id; 3679 3680 3681 this.dialogHolder._dialog = this; 3682 3683 this.header(); 3684 this.footer(); 3685 this.draggable(); 3686 3687 3688 3689 this.dialogContainer = this.options.root.createElement('div'); 3690 this.dialogContainer._dialog = this; 3691 3692 // TODO: obsolate 3693 this.container = this.dialogContainer; 3694 3695 3696 this.dialogContainer.className = 'mw-dialog-container'; 3697 this.dialogHolder.className = 'mw-dialog-holder'; 3698 3699 var cont = this.options.content; 3700 if(this.options.shadow) { 3701 this.shadow = this.dialogContainer.attachShadow({ 3702 mode: 'open' 3703 }); 3704 if(typeof cont === 'string') { 3705 this.shadow.innerHTML = (cont); 3706 } else { 3707 this.shadow.appendChild(cont); 3708 } 3709 } else { 3710 mw.$(this.dialogContainer).append(cont); 3711 } 3712 3713 3714 if (this.options.encapsulate) { 3715 this.iframe = cont; 3716 this.iframe.style.display = ''; 3717 } 3718 3719 this.dialogHolder.appendChild(this.dialogHeader); 3720 this.dialogHolder.appendChild(this.dialogContainer); 3721 this.dialogHolder.appendChild(this.dialogFooter); 3722 3723 this.closeButton = this.options.root.createElement('div'); 3724 this.closeButton.className = 'mw-dialog-close'; 3725 3726 this.closeButton.$scope = this; 3727 3728 this.closeButton.onclick = function (e) { 3729 e.preventDefault(); 3730 this.$scope[this.$scope.options.closeButtonAction](); 3731 $(this.$scope).trigger('closedByUser'); 3732 }; 3733 this.main = mw.$(this.dialogContainer); // obsolete 3734 this.main.width = this.width; 3735 3736 this.width(this.options.width || 600); 3737 this.height(this.options.height || 320); 3738 3739 this.options.root.body.appendChild(this.dialogMain); 3740 this.dialogMain.appendChild(this.dialogHolder); 3741 3742 if (this.options.closeButtonAppendTo) { 3743 if (this.options.closeButton !== false) { 3744 mw.$(this.options.closeButtonAppendTo, this.dialogMain).append(this.closeButton) 3745 } 3746 } 3747 else { 3748 if (this.options.closeButton !== false) { 3749 this.dialogHolder.appendChild(this.closeButton); 3750 } 3751 } 3752 3753 this.dialogOverlay(); 3754 return this; 3755 }; 3756 3757 this._doCloseButton = function() { 3758 this[this.options.closeButtonAction](); 3759 }; 3760 3761 this.containmentManage = function () { 3762 if (scope.options.containment === 'window') { 3763 if (scope.options.scrollMode === 'inside') { 3764 var rect = this.dialogHolder.getBoundingClientRect(); 3765 var $win = mw.$(window); 3766 var sctop = $win.scrollTop(); 3767 var height = $win.height(); 3768 if (rect.top < sctop || (sctop + height) > (rect.top + rect.height)) { 3769 this.center(); 3770 } 3771 } 3772 } 3773 }; 3774 3775 this.dialogOverlay = function () {
3776 this.overlay = this.options.root.createElement('div'); 3777 this.overlay.className = 'mw-dialog-overlay'; 3778 this.overlay.$scope = this; 3779 if (this.options.overlay === true || typeof this.options.overlay === 'string') { 3780 this.dialogMain.appendChild(this.overlay); 3781 if( typeof this.options.overlay === 'string' ) { 3782 this.overlay.style.backgroundColor = this.options.overlay; 3783 } 3784 3785 } 3786 mw.$(this.overlay).on('click', function () { 3787 if (typeof this.$scope.options.overlayClose === 'function') { 3788 if (this.$scope.options.overlayClose() === true) { 3789 this.$scope._doCloseButton(); 3790 $(this.$scope).trigger('closedByUser'); 3791 } 3792 } else if (this.$scope.options.overlayClose === true) { 3793 this.$scope._doCloseButton(); 3794 $(this.$scope).trigger('closedByUser'); 3795 } 3796 }); 3797 return this; 3798 }; 3799 3800 this._afterSize = function() { 3801 if(mw._iframeDetector) { 3802 mw._iframeDetector.pause = true; 3803 var frame = window.frameElement; 3804 if(frame && parent !== top){ 3805 var height = this.dialogContainer.scrollHeight + this.dialogHeader.scrollHeight; 3806 if($(frame).height() < height) { 3807 frame.style.height = ((height + 100) - this.dialogHeader.offsetHeight - this.dialogFooter.offsetHeight) + 'px'; 3808 if(window.thismodal){ 3809 thismodal.height(height + 100); 3810 } 3811 3812 } 3813 } 3814 } 3815 }; 3816 3817 this.show = function () { 3818 mw.$(this.dialogMain).find('iframe').each(function(){ 3819 this._intPause = false; 3820 }); 3821 mw.$(this.dialogMain).addClass('active'); 3822 this.center(); 3823 this._afterSize(); 3824 mw.$(this).trigger('Show'); 3825 mw.trigger('mwDialogShow', this); 3826 return this; 3827 }; 3828 3829 this._hideStart = false;
3830 this.hide = function () { 3831 if (!this._hideStart) { 3832 this._hideStart = true; 3833 mw.$(this.dialogMain).find('iframe').each(function(){ 3834 this._intPause = true; 3835 }); 3836 setTimeout(function () { 3837 scope._hideStart = false; 3838 }, 300); 3839 mw.$(this.dialogMain).removeClass('active'); 3840 if(mw._iframeDetector) { 3841 mw._iframeDetector.pause = false; 3842 } 3843 mw.$(this).trigger('Hide'); 3844 mw.trigger('mwDialogHide', this); 3845 } 3846 return this; 3847 }; 3848 3849 this.forceRemove = function () { 3850 mw.$(this.dialogMain).remove(); 3851 for (var i = 0; i < mw.top().__dialogs.length; i++) { 3852 if (mw.top().__dialogs[i] === this) { 3853 mw.top().__dialogs.splice(i, 1); 3854 break; 3855 } 3856 } 3857 clearInterval(this._observe.interval); 3858 return this; 3859 } 3860 this.remove = function () { 3861 3862 mw.$(this).trigger('BeforeRemove'); 3863 if (typeof this.options.beforeRemove === 'function') { 3864 if(this.options.beforeRemove(this) === false) { 3865 return; 3866 } 3867 } 3868 3869 this.hide(); 3870 mw.removeInterval('iframe-' + this.id); 3871 3872 if(this.options.onremove) { 3873 this.options.onremove() 3874 } 3875 mw.$(this).trigger('Remove'); 3876 mw.trigger('mwDialogRemove', this); 3877 3878 this.forceRemove() 3879 }; 3880 3881 this.destroy = this.remove; 3882 3883 this._prevHeight = -1; 3884 this._dragged = false; 3885 3886 this.center = function (width, height) { 3887 var $holder = mw.$(this.dialogHolder), $window = mw.$(window); 3888 var holderHeight = height || $holder.outerHeight(); 3889 var holderWidth = width || $holder.outerWidth(); 3890 var dtop, css = {}; 3891 3892 if (this.options.centerMode === 'intuitive' && this._prevHeight < holderHeight) { 3893 dtop = $window.height() / 2 - holderHeight / 2; 3894 } else if (this.options.centerMode === 'center') { 3895 dtop = $window.height() / 2 - holderHeight / 2; 3896 } 3897 3898 if (!scope._dragged) { 3899 css.left = $window.outerWidth() / 2 - holderWidth / 2; 3900 } else { 3901 css.left = parseFloat($holder.css('left')); 3902 } 3903 3904 if(css.left + holderWidth > $window.width()){ 3905 css.left = css.left - ((css.left + holderWidth) - $window.width()); 3906 } 3907 3908 if (dtop) { 3909 css.top = dtop > 0 ? dtop : 0; 3910 } 3911 3912 3913 3914 /*if(window !== mw.top().win && document.body.scrollHeight > mw.top().win.innerHeight){ 3915 $win = $(mw.top()); 3916 3917 css.top = $(document).scrollTop() + 50; 3918 var off = $(window.frameElement).offset(); 3919 if(off.top < 0) { 3920 css.top += Math.abs(off.top); 3921 } 3922 if(window.thismodal) { 3923 css.top += thismodal.dialogContainer.scrollTop; 3924 } 3925 3926 }*/ 3927 3928 3929 $holder.css(css); 3930 this._prevHeight = holderHeight; 3931 3932 3933 this._afterSize(); 3934 mw.$(this).trigger('dialogCenter'); 3935 3936 return this; 3937 }; 3938 3939 this.width = function (width) { 3940 if(!width) { 3941 return mw.$(this.dialogHolder).outerWidth(); 3942 } 3943 mw.$(this.dialogHolder).width(width); 3944 this._afterSize(); 3945 }; 3946 this.height = function (height) { 3947 if(!height) { 3948 return mw.$(this.dialogHolder).outerHeight(); 3949 } 3950 mw.$(this.dialogHolder).height(height); 3951 this._afterSize(); 3952 }; 3953 this.resize = function (width, height) { 3954 if (typeof width !== 'undefined') { 3955 this.width(width); 3956 } 3957 if (typeof height !== 'undefined') { 3958 this.height(height); 3959 } 3960 this.center(width, height); 3961 }; 3962 this.content = function (content) { 3963 this.options.content = content || ''; 3964 $(this.dialogContainer).empty().append(this.options.content); 3965 return this; 3966 }; 3967 3968 this.result = function(result, doClose) { 3969 this.value = result; 3970 if(this.options.onResult){ 3971 this.options.onResult.call( this, result ); 3972 } 3973 if (cres) { 3974 cres.call( this, result ); 3975 } 3976 $(this).trigger('Result', [result]); 3977 if(doClose){ 3978 this._doCloseButton(); 3979 } 3980 }; 3981 3982 3983 this.contentMaxHeight = function () { 3984 var scope = this; 3985 if (this.options.scrollMode === 'inside') { 3986 mw.interval('iframe-' + this.id, function () { 3987 var max = mw.$(window).height() - scope.dialogHeader.clientHeight - scope.dialogFooter.clientHeight - 40; 3988 scope.dialogContainer.style.maxHeight = max + 'px'; 3989 scope.dialogContainer.style.maxHeight = 'calc(100vh - 100px)'; 3990 scope.containmentManage(); 3991 }); 3992 } 3993 }; 3994 3995 this._observe = {}; 3996 this.observeDimensions = function(cb) { 3997 if (!this._observe.interval) { 3998 var changed = function () { 3999 var css = getComputedStyle(scope.dialogMain); 4000 if (!scope._observe.data) { 4001 scope._observe.data = { 4002 width: css.width, 4003 height: css.height 4004 }; 4005 return { 4006 width: css.width, 4007 height: css.height 4008 }; 4009 } else { 4010 var curr = scope._observe.data; 4011 // if(curr.width !== css.width || curr.height !== css.height) { 4012 scope._observe.data = { 4013 width: css.width, 4014 height: css.height 4015 }; 4016 return { 4017 width: css.width, 4018 height: css.height 4019 }; 4020 // } 4021 } 4022 }; 4023 this._observe.interval = setInterval(function (){ 4024 var chg = changed(); 4025 if (chg) { 4026 cb.call(scope, chg); 4027 } 4028 4029 }, 333); 4030 } 4031 }; 4032 4033 this.position = function (x, y) { 4034 if(!x) { 4035 return; 4036 } 4037 scope._dragged = true; 4038 if(typeof x === 'object') { 4039 y = x.y; 4040 x = x.x; 4041 } 4042 4043 if(typeof y === 'undefined') { 4044 y = x 4045 } 4046 4047 if(typeof x === 'number') { 4048 x += 'px'; 4049 4050 } 4051 4052 if(typeof y === 'number') { 4053 y += 'px'; 4054 } 4055 4056 this.dialogHolder.style.left = x; 4057 this.dialogHolder.style.top = y; 4058 4059 return this; 4060 } 4061 4062 this.positionToElement = function(targetElementSelector) { 4063 if(!targetElementSelector){ 4064 return; 4065 } 4066 4067 4068 var node = $(targetElementSelector)[0]; 4069 var nodeWindow = node.ownerDocument.defaultView; 4070
4071 let off = mw.element(node).offset(); 4072 if(nodeWindow.frameElement) { 4073 var winframe = mw.top().element(nodeWindow.frameElement).offset(); 4074 off.offsetTop += winframe.offsetTop 4075 off.offsetLeft += winframe.offsetLeft 4076 } 4077 this.position(off.offsetLeft, off.offsetTop + off.height); 4078 setTimeout( ()=> { 4079 const colorPickerDialogOff = mw.element(this.dialogHolder).offset() 4080 if(colorPickerDialogOff.offsetTop + colorPickerDialogOff.height > mw.top().win.innerHeight) { 4081 this.position(off.offsetLeft - colorPickerDialogOff.width, mw.top().win.innerHeight - colorPickerDialogOff.height); 4082 } 4083 }, 10); 4084 4085 } 4086 4087 this.calculateDialogPositionXY = function (element) { 4088 4089 var position = {}; 4090 if (self !== top) { 4091 position = this.getElementPositionInFrames(element); 4092 } else { 4093 position = this.getElementPositionOnScreen(element); 4094 } 4095 4096 let newPositionX = position.x; 4097 let newPositionY = position.y; 4098 4099 4100 let elementBounding = element.getBoundingClientRect(); 4101 let dialogBounding = this.dialogMain.getBoundingClientRect(); 4102 4103 let repositionDialog = this.positionDialogWithoutOverlap(this.dialogMain, element); 4104 if (repositionDialog) { 4105 newPositionX = repositionDialog.x; 4106 newPositionY = repositionDialog.y; 4107 } 4108 4109 4110 // newPositionX = (newPositionX + elementBounding.width) - 50; 4111 4112 // if ((window.top.innerWidth - newPositionX) < (dialogBounding.width - 50)) { 4113 // newPositionX = newPositionX - dialogBounding.width - (window.top.innerWidth - newPositionX); 4114 // } 4115 // 4116 // if ((window.top.innerHeight - newPositionY) < (dialogBounding.height - 50)) { 4117 // newPositionY = newPositionY - dialogBounding.height + (window.top.innerHeight - newPositionY); 4118 // } 4119 4120 if (newPositionX < 0) { 4121 newPositionX = 0; 4122 } 4123 4124 if (newPositionY < 0) { 4125 newPositionY = 0; 4126 } 4127 4128 console.log('innerWidth', elementBounding.width); 4129 console.log('innerHeight', elementBounding.height); 4130 4131 console.log('newPositionX', newPositionX); 4132 console.log('newPositionY', newPositionY); 4133 4134 this.options.position = { 4135 x: newPositionX, 4136 y: newPositionY 4137 }; 4138 this.position(newPositionX, newPositionY); 4139 } 4140 4141 this.positionDialogWithoutOverlap = function (dialogElement, targetElement) { 4142 var dialogRect = dialogElement.getBoundingClientRect(); 4143 var targetRect = targetElement.getBoundingClientRect(); 4144 4145 var dialogWidth = dialogRect.width; 4146 var dialogHeight = dialogRect.height; 4147 4148 var targetLeft = targetRect.left; 4149 var targetTop = targetRect.top; 4150 var targetWidth = targetRect.width; 4151 var targetHeight = targetRect.height; 4152 4153 var currentWindow = window; 4154 4155 while (currentWindow !== top) { 4156 var iframe = currentWindow.frameElement; 4157 var iframeRect = iframe.getBoundingClientRect(); 4158 4159 targetLeft += iframeRect.left; 4160 targetTop += iframeRect.top; 4161 4162 currentWindow = currentWindow.parent; 4163 } 4164 4165 var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 4166 var screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 4167 4168 var spaceRight = screenWidth - targetLeft - targetWidth; 4169 var spaceBelow = screenHeight - targetTop - targetHeight; 4170 4171 var dialogLeft, dialogTop; 4172 4173 if (spaceRight >= dialogWidth) { 4174 dialogLeft = targetLeft + targetWidth; 4175 dialogTop = Math.max(targetTop + (targetHeight - dialogHeight) / 2, 0); 4176 }
4176 else if (spaceBelow >= dialogHeight) { 4177 dialogLeft = targetLeft + (targetWidth - dialogWidth) / 2; 4178 dialogTop = targetTop + targetHeight; 4179 } else { 4180 // Fallback position if there is not enough space on the right or below 4181 dialogLeft = targetLeft + targetWidth; 4182 dialogTop = Math.max(targetTop + (targetHeight - dialogHeight) / 2, 0); 4183 } 4184 4185 return { 4186 x: dialogLeft, 4187 y: dialogTop 4188 } 4189 } 4190 4191 this.getElementPositionInFrames = function (element) { 4192 var x = 0; 4193 var y = 0; 4194 var currentWindow = window; 4195 4196 while (currentWindow !== top) { 4197 var iframe = currentWindow.frameElement; 4198 var iframeRect = iframe.getBoundingClientRect(); 4199 var elementRect = element.getBoundingClientRect(); 4200 4201 x += iframeRect.left + elementRect.left; 4202 y += iframeRect.top + elementRect.top; 4203 4204 currentWindow = currentWindow.parent; 4205 } 4206 4207 return { x: x, y: y }; 4208 } 4209 4210 this.getElementPositionOnScreen = function(element) { 4211 var rect = element.getBoundingClientRect(); 4212 4213 var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft; 4214 var scrollTop = window.pageYOffset || document.documentElement.scrollTop; 4215 4216 var x = rect.left + scrollLeft; 4217 var y = rect.top + scrollTop; 4218 4219 // Adjust position to stay within the visible screen area 4220 var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 4221 var screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 4222 4223 x = Math.min(Math.max(x, 0), screenWidth - element.offsetWidth); 4224 y = Math.min(Math.max(y, 0), screenHeight - element.offsetHeight); 4225 4226 return { x: x, y: y }; 4227 } 4228 4229 this.init = function () { 4230 this.build(); 4231 this.contentMaxHeight(); 4232 if(!this.options.position) { 4233 4234 this.center(); 4235 } 4236 4237 this.show(); 4238 if (this.options.autoCenter) { 4239 (function (scope) { 4240 mw.$(window).on('resize orientationchange load', function () { 4241 scope.contentMaxHeight(); 4242 scope.center(); 4243 }); 4244 })(this); 4245 } 4246 if (!this.options.pauseInit) { 4247 mw.$(this).trigger('Init'); 4248 } 4249 this.observeDimensions(function (){ 4250 scope.center(); 4251 }); 4252 if(this.options.position) { 4253 this.position(this.options.position) 4254 } 4255 return this; 4256 }; 4257 this.init(); 4258 }; 4259 4260 mw.Dialog.elementIsInDialog = function (node) { 4261 return mw.tools.firstParentWithClass(node, 'mw-dialog'); 4262 }; 4263 4264})(window.mw); 4265 4266 4267(function () { 4268 function scoped() { 4269 var all = document.querySelectorAll('style[scoped]'), i = 0; 4270 4271 try { 4272 for( ; i < all.length; i++ ) { 4273 var parent = all[i].parentNode; 4274 parent.id = parent.id || mw.id('scoped-id-'); 4275 var prefix = '#' + parent.id + ' '; 4276 var rules = all[i].sheet.rules; 4277 var r = 0; 4278 for ( ; r < rules.length; r++) { 4279 var newRule = prefix + rules[r].cssText; 4280 all[i].sheet.deleteRule(r); 4281 all[i].sheet.insertRule(newRule, r); 4282 } 4283 all[i].removeAttribute('scoped'); 4284 } 4285 } 4286 catch(error) { 4287 4288 } 4289 4290 4291 } 4292 scoped(); 4293 $(window).on('load', function () { 4294 scoped(); 4295 }); 4296})(); 4297 4298 4299 4300 4301mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/domhelpers.js'); 4302 4303(function(){ 4304var domHelp = { 4305 classNamespaceDelete: function (el_obj, namespace, parent, namespacePosition, exception) { 4306 if (el_obj.element && el_obj.namespace) { 4307 el = el_obj.element; 4308 namespace = el_obj.namespace; 4309 parent = el_obj.parent; 4310 namespacePosition = el_obj.namespacePosition; 4311 exceptions = el_obj.exceptions || []; 4312 } 4313 else { 4314 el = el_obj; 4315 exceptions = []; 4316 } 4317 namespacePosition = namespacePosition || 'contains'; 4318 parent = parent || mwd; 4319 if (el === 'all') { 4320 var all = parent.querySelectorAll('.edit *'), i = 0, l = all.length; 4321 for (; i < l; i++) { 4322 mw.tools.classNamespaceDelete(all[i], namespace, parent, namespacePosition) 4323 } 4324 return; 4325 } 4326 if (!!el.className && typeof(el.className.split) === 'function') { 4327 var cls = el.className.split(" "), l = cls.length, i = 0, final = []; 4328 for (; i < l; i++) { 4329 if (namespacePosition === 'contains') { 4330 if (!cls[i].contains(namespace) || exceptions.indexOf(cls[i]) !== -1) {
4331 final.push(cls[i]); 4332 } 4333 } 4334 else if (namespacePosition === 'starts') { 4335 if (cls[i].indexOf(namespace) !== 0) { 4336 final.push(cls[i]); 4337 } 4338 } 4339 } 4340 el.className = final.join(" "); 4341 } 4342 }, 4343 firstWithBackgroundImage: function (node) { 4344 if (!node) return false; 4345 if (!!node.style.backgroundImage) return node; 4346 var final = false; 4347 mw.tools.foreachParents(node, function (loop) { 4348 if (!!this.style.backgroundImage) { 4349 mw.tools.stopLoop(loop); 4350 final = this; 4351 } 4352 }); 4353 return final; 4354 }, 4355 4356 parentsOrCurrentOrderMatchOrOnlyFirstOrNone: function (node, arr) { 4357 return !mw.tools.hasAnyOfClassesOnNodeOrParent(node, [arr[1]]) || mw.tools.parentsOrCurrentOrderMatchOrOnlyFirst(node, arr) 4358 }, 4359 parentsOrCurrentOrderMatchOrOnlyFirst: function (node, arr) { 4360 var curr = node; 4361 while (curr && curr.classList) { 4362 var h1 = mw.tools.hasClass(curr, arr[0]); 4363 var h2 = mw.tools.hasClass(curr, arr[1]); 4364 if (h1 && h2) { 4365 return false; 4366 } 4367 else { 4368 if (h1) { 4369 return true; 4370 } 4371 else if (h2) { 4372 return false; 4373 } 4374 } 4375 curr = curr.parentNode; 4376 } 4377 return false; 4378 }, 4379 parentsOrCurrentOrderMatchOrOnlyFirstOrNone: function (node, arr) { 4380 var curr = node; 4381 while (curr && curr.classList) { 4382 var h1 = mw.tools.hasClass(curr, arr[0]); 4383 var h2 = mw.tools.hasClass(curr, arr[1]); 4384 if (h1 && h2) { 4385 return false; 4386 } 4387 else { 4388 if (h1) { 4389 return true; 4390 } 4391 else if (h2) { 4392 return false; 4393 } 4394 } 4395 curr = curr.parentNode; 4396 } 4397 return true; 4398 }, 4399 parentsOrCurrentOrderMatch: function (node, arr) { 4400 var curr = node, 4401 match = {a: 0, b: 0}, 4402 count = 1, 4403 hadA = false;
4404 while (curr && curr.classList) { 4405 count++; 4406 var h1 = mw.tools.hasClass(curr, arr[0]); 4407 var h2 = mw.tools.hasClass(curr, arr[1]); 4408 if (h1 && h2) { 4409 if (match.a > 0) { 4410 return true; 4411 } 4412 return false; 4413 } 4414 else { 4415 if (h1) { 4416 match.a = count; 4417 hadA = true; 4418 } 4419 else if (h2) { 4420 match.b = count; 4421 } 4422 if (match.b > match.a) { 4423 return hadA ? true : false; 4424 } 4425 } 4426 curr = curr.parentNode; 4427 } 4428 return false; 4429 }, 4430 parentsOrCurrentOrderMatchOrNone:function(node, arr){ 4431 if(!node) return false; 4432 var curr = node, 4433 match = {a: 0, b: 0}, 4434 count = 1, 4435 hadA = false; 4436 while (curr && curr.classList) { 4437 count++; 4438 var h1 = mw.tools.hasClass(curr, arr[0]); 4439 var h2 = mw.tools.hasClass(curr, arr[1]); 4440 if (h1 && h2) { 4441 if (match.a > 0) { 4442 return true; 4443 } 4444 return false; 4445 } 4446 else { 4447 if (h1) { 4448 match.a = count; 4449 hadA = true; 4450 } 4451 else if (h2) { 4452 match.b = count; 4453 } 4454 if (match.b > match.a) { 4455 return hadA ? true : false; 4456 } 4457 } 4458 curr = curr.parentNode; 4459 } 4460 return match.a === 0 && match.b === 0; 4461 }, 4462 parentsOrCurrentOrderMatchOrOnlyFirstOrBoth: function (node, arr) { 4463 var curr = node, 4464 has1 = false, 4465 has2 = false; 4466 while (curr && curr.classList) { 4467 var h1 = mw.tools.hasClass(curr, arr[0]); 4468 var h2 = mw.tools.hasClass(curr, arr[1]); 4469 if (h1 && h2) { 4470 return true; 4471 } 4472 else { 4473 if (h1) { 4474 return true; 4475 } 4476 else if (h2) { 4477 return false; 4478 } 4479 } 4480 curr = curr.parentNode; 4481 } 4482 return false; 4483 }, 4484 matchesAnyOnNodeOrParent: function (node, arr) { 4485 var curr = node; 4486 while (curr && curr.classList) { 4487 var i = 0; 4488 for (; i < arr.length; i++) { 4489 if (mw.tools.matches(curr, arr[i])) { 4490 return true; 4491 } 4492 } 4493 curr = curr.parentNode; 4494 } 4495 return false; 4496 }, 4497 firstMatchesOnNodeOrParent: function (node, arr) { 4498 if (!arr) return; 4499 if (typeof arr === 'string') { 4500 arr = [arr]; 4501 } 4502 var curr = node; 4503 while (curr && curr.classList) { 4504 var i = 0; 4505 for (; i < arr.length; i++) { 4506 if (mw.tools.matches(curr, arr[i])) { 4507 return curr; 4508 } 4509 } 4510 curr = curr.parentNode; 4511 } 4512 return false; 4513 }, 4514 lastMatchesOnNodeOrParent: function (node, arr) { 4515 if (!arr) return; 4516 if (typeof arr === 'string') { 4517 arr = [arr]; 4518 } 4519 var curr = node, result; 4520 while (curr && curr.classList) { 4521 var i = 0; 4522 for (; i < arr.length; i++) { 4523 if (mw.tools.matches(curr, arr[i])) { 4524 result = curr; 4525 } 4526 } 4527 curr = curr.parentNode; 4528 } 4529 return result; 4530 }, 4531 hasAnyOfClassesOnNodeOrParent: function (node, arr) { 4532 var curr = node; 4533 while (curr && curr.classList) { 4534 var i = 0; 4535 for (; i < arr.length; i++) { 4536 if (mw.tools.hasClass(curr, arr[i])) { 4537 return true; 4538 } 4539 } 4540 curr = curr.parentNode; 4541 } 4542 return false; 4543 }, 4544 hasClass: function (classname, whattosearch) { 4545 if (classname === null) { 4546 return false;
4547 } 4548 if (typeof classname === 'string') { 4549 return classname.split(' ').indexOf(whattosearch) > -1; 4550 } 4551 else if (typeof classname === 'object') { 4552 return mw.tools.hasClass(classname.className, whattosearch); 4553 } 4554 else { 4555 return false; 4556 } 4557 }, 4558 hasAllClasses: function (node, arr) { 4559 if (!node) return; 4560 var has = true; 4561 var i = 0, nodec = node.className.trim().split(' '); 4562 for (; i < arr.length; i++) { 4563 if (nodec.indexOf(arr[i]) === -1) { 4564 return false; 4565 } 4566 } 4567 return has; 4568 }, 4569 hasAnyOfClasses: function (node, arr) { 4570 if (!node) return; 4571 var i = 0, l = arr.length, cls = node.className; 4572 for (; i < l; i++) { 4573 if (mw.tools.hasClass(cls, arr[i])) { 4574 return true; 4575 } 4576 } 4577 return false; 4578 }, 4579 4580 4581 hasParentsWithClass: function (el, cls) { 4582 if (!el) return; 4583 var curr = el.parentNode; 4584 while (curr && curr.classList) { 4585 if (mw.tools.hasClass(curr, cls)) { 4586 return true; 4587 } 4588 curr = curr.parentNode; 4589 } 4590 return false; 4591 }, 4592 hasParentWithId: function (el, id) { 4593 if (!el) return; 4594 var curr = el.parentNode; 4595 while (curr && curr.classList) { 4596 if (curr.id === id) { 4597 return true; 4598 } 4599 curr = curr.parentNode; 4600 } 4601 return false; 4602 }, 4603 4604 hasChildrenWithTag: function (el, tag) { 4605 tag = tag.toLowerCase(); 4606 var has = false; 4607 mw.tools.foreachChildren(el, function (loop) { 4608 if (this.nodeName.toLowerCase() === tag) { 4609 has = true; 4610 mw.tools.stopLoop(loop); 4611 } 4612 }); 4613 return has; 4614 }, 4615 hasParentsWithTag: function (el, tag) { 4616 if (!el || !tag) return; 4617 tag = tag.toLowerCase(); 4618 var curr = el.parentNode; 4619 while (curr && curr.classList) { 4620 if (curr.nodeName.toLowerCase() === tag) { 4621 return true; 4622 } 4623 curr = curr.parentNode; 4624 } 4625 return false; 4626 }, 4627 hasHeadingParent: function (el) { 4628 if (!el) return; 4629 var h = /^(h[1-6])$/i; 4630 var curr = el.parentNode; 4631 while (curr && curr.classList) { 4632 if (h.test(curr.nodeName.toLowerCase())) { 4633 return true; 4634 } 4635 curr = curr.parentNode; 4636 } 4637 return false; 4638 }, 4639 addClass: function (el, cls) { 4640 if (!cls || !el) { 4641 return false; 4642 } 4643 if (el.fn) { 4644 el = el[0]; 4645 if (!el) { 4646 return; 4647 } 4648 } 4649 if (typeof cls === 'string') { 4650 cls = cls.trim(); 4651 } 4652 if (!el) return; 4653 var arr = cls.split(" "); 4654 var i = 0; 4655 if (arr.length > 1) { 4656 for (; i < arr.length; i++) { 4657 mw.tools.addClass(el, arr[i]); 4658 } 4659 return; 4660 } 4661 if (typeof el === 'object') { 4662 if (el.classList) { 4663 el.classList.add(cls); 4664 } 4665 else { 4666 if (!mw.tools.hasClass(el.className, cls)) el.className += (' ' + cls); 4667 } 4668 } 4669 if (typeof el === 'string') { 4670 if (!mw.tools.hasClass(el, cls)) el += (' ' + cls); 4671 } 4672 }, 4673 removeClass: function (el, cls) { 4674 if (typeof cls === 'string') { 4675 cls = cls.trim(); 4676 } 4677 if (!cls || !el) return; 4678 if (el === null) { 4679 return false; 4680 } 4681 if (el.fn) { 4682 el = el[0]; 4683 if (!el) { 4684 return; 4685 } 4686 } 4687 if (typeof el === 'undefined') { 4688 return false; 4689 } 4690 if (el.constructor === [].constructor) { 4691 var i = 0, l = el.length; 4692 for (; i < l; i++) { 4693 mw.tools.removeClass(el[i], cls); 4694 } 4695 return; 4696 } 4697 if (typeof(cls) === 'object') { 4698 var arr = cls; 4699 } else { 4700 var arr = cls.split(" "); 4701 } 4702 var i = 0; 4703 if (arr.length > 1) { 4704 for (; i < arr.length; i++) { 4705 mw.tools.removeClass(el, arr[i]); 4706 } 4707 return; 4708 } 4709 else if (!arr.length) { 4710 return; 4711 } 4712 if (el.classList && cls) { 4713 el.classList.remove(cls); 4714 } 4715 else { 4716 if (mw.tools.hasClass(el.className, cls)) el.className = (el.className + ' ').replace(cls + ' ', '').replace(/\s{2,}/g, ' ').trim(); 4717 } 4718 4719 }, 4720 isEventOnElement: function (event, node) { 4721 if (event.target === node) { 4722 return true; 4723 } 4724 mw.tools.foreachParents(event.target, function () { 4725 if (event.target === node) { 4726 return true; 4727 } 4728 }); 4729 return false;
4730 }, 4731 isEventOnElements: function (event, array) { 4732 var l = array.length, i = 0; 4733 for (; i < l; i++) { 4734 if (event.target === array[i]) { 4735 return true; 4736 } 4737 } 4738 var isEventOnElements = false; 4739 mw.tools.foreachParents(event.target, function () { 4740 var l = array.length, i = 0; 4741 for (; i < l; i++) { 4742 if (event.target === array[i]) { 4743 isEventOnElements = true; 4744 } 4745 } 4746 }); 4747 return isEventOnElements; 4748 }, 4749 isEventOnClass: function (event, cls) { 4750 if (mw.tools.hasClass(event.target, cls) || mw.tools.hasParentsWithClass(event.target, cls)) { 4751 return true; 4752 } 4753 return false; 4754 }, 4755 firstChildWithClass: function (parent, cls) { 4756 var toreturn; 4757 mw.tools.foreachChildren(parent, function (loop) { 4758 if (this.nodeType === 1 && mw.tools.hasClass(this, cls)) { 4759 mw.tools.stopLoop(loop); 4760 toreturn = this; 4761 } 4762 }); 4763 return toreturn; 4764 }, 4765 firstChildWithTag: function (parent, tag) { 4766 var toreturn; 4767 var tag = tag.toLowerCase(); 4768 mw.tools.foreachChildren(parent, function (loop) { 4769 if (this.nodeName.toLowerCase() === tag) { 4770 toreturn = this; 4771 mw.tools.stopLoop(loop); 4772 } 4773 }); 4774 return toreturn; 4775 }, 4776 hasChildrenWithClass: function (node, cls) { 4777 var final = false;
4778 mw.tools.foreachChildren(node, function () { 4779 if (mw.tools.hasClass(this.className, cls)) { 4780 final = true; 4781 } 4782 }); 4783 return final; 4784 }, 4785 parentsOrder: function (node, arr) { 4786 var only_first = []; 4787 var obj = {}, l = arr.length, i = 0, count = -1; 4788 for (; i < l; i++) { 4789 obj[arr[i]] = -1; 4790 } 4791 if (!node) return obj; 4792 4793 var curr = node.parentNode; 4794 while (curr && curr.classList) { 4795 count++; 4796 var cls = curr.className; 4797 i = 0; 4798 for (; i < l; i++) { 4799 if (mw.tools.hasClass(cls, arr[i]) && only_first.indexOf(arr[i]) === -1) { 4800 obj[arr[i]] = count; 4801 only_first.push(arr[i]); 4802 } 4803 } 4804 curr = curr.parentNode; 4805 } 4806 return obj; 4807 }, 4808 parentsAndCurrentOrder: function (node, arr) { 4809 var only_first = []; 4810 var obj = {}, l = arr.length, i = 0, count = -1; 4811 for (; i < l; i++) { 4812 obj[arr[i]] = -1; 4813 } 4814 if (!node) return obj; 4815 4816 var curr = node; 4817 while (curr && curr.classList) { 4818 count++; 4819 var cls = curr.className; 4820 i = 0; 4821 for (; i < l; i++) { 4822 if (mw.tools.hasClass(cls, arr[i]) && only_first.indexOf(arr[i]) === -1) { 4823 obj[arr[i]] = count; 4824 only_first.push(arr[i]); 4825 } 4826 } 4827 curr = curr.parentNode; 4828 } 4829 return obj; 4830 }, 4831 firstParentWithClass: function (el, cls) { 4832 if (!el) return false; 4833 var curr = el.parentNode; 4834 while (curr && curr.classList) { 4835 if (curr.classList.contains(cls)) { 4836 return curr; 4837 } 4838 curr = curr.parentNode; 4839 } 4840 return false; 4841 }, 4842 firstParentOrCurrentWithClass: function (el, cls) { 4843 if (!el) return false; 4844 var curr = el; 4845 while (curr && curr.classList) { 4846 if (mw.tools.hasClass(curr, cls)) { 4847 return curr; 4848 } 4849 curr = curr.parentNode; 4850 } 4851 return false; 4852 }, 4853 firstBlockLikeLevel: function (el) { 4854 var blockLikes = ['TD', 'DIV', 'LI', 'DD', 'DT', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'MAIN', 'HEADER', 'P']; 4855 while(el && el.classList) { 4856 if(mw.tools.isBlockLevel(el) || blockLikes.indexOf(el.nodeName) !== -1 ) { 4857 return el; 4858 } 4859 el = el.parentNode; 4860 } 4861 }, 4862 firstBlockLevel: function (el) { 4863 while(el && el.classList) { 4864 if(mw.tools.isBlockLevel(el)) { 4865 return el; 4866 } 4867 el = el.parentNode; 4868 } 4869 }, 4870 firstNotInlineLevel: function (el) { 4871 if(el.nodeType !== 1) { 4872 el = el.parentNode 4873 } 4874 if(!el) { 4875 return; 4876 } 4877 while(el && el.classList) { 4878 if(!mw.tools.isInlineLevel(el)) { 4879 return el; 4880 } 4881 el = el.parentNode; 4882 } 4883 }, 4884 firstParentOrCurrentWithId: function (el, id) { 4885 if (!el) return false; 4886 var curr = el; 4887 while (curr && el.classList) { 4888 if (curr.id === id) { 4889 return curr; 4890 } 4891 curr = curr.parentNode; 4892 } 4893 return false; 4894 }, 4895 firstParentOrCurrentWithAllClasses: function (node, arr) { 4896 if (!node) return false; 4897 var curr = node; 4898 while (curr && curr.classList) { 4899 if (mw.tools.hasAllClasses(curr, arr)) { 4900 return curr; 4901 } 4902 curr = curr.parentNode; 4903 } 4904 return false; 4905 }, 4906 firstParentOrCurrentWithAnyOfClasses: function (node, arr) { 4907 if (!node) return false; 4908 var curr = node; 4909 while (curr && curr.classList) { 4910 if (!curr) return false; 4911 if (mw.tools.hasAnyOfClasses(curr, arr)) { 4912 return curr; 4913 } 4914 curr = curr.parentNode; 4915 } 4916 return false;
4917 }, 4918 lastParentWithClass: function (el, cls) { 4919 if (!el) return; 4920 var _has = false; 4921 var curr = el.parentNode; 4922 while (curr && curr.classList) { 4923 if (mw.tools.hasClass(curr, cls)) { 4924 _has = curr; 4925 } 4926 curr = curr.parentNode; 4927 } 4928 return _has; 4929 }, 4930 firstParentWithTag: function (el, tag) { 4931 if (!el || !tag) return; 4932 tag = typeof tag !== 'string' ? tag : [tag]; 4933 var curr = el.parentNode; 4934 while (curr && curr.classList) { 4935 if (tag.indexOf(curr.nodeName.toLowerCase()) !== -1) { 4936 return curr; 4937 } 4938 curr = curr.parentNode; 4939 } 4940 return false; 4941 }, 4942 firstParentOrCurrentWithTag: function (el, tag) { 4943 if (!el || !tag) return; 4944 tag = typeof tag !== 'string' ? tag : [tag]; 4945 var curr = el; 4946 while (curr && curr.classList) { 4947 if (tag.indexOf(curr.nodeName.toLowerCase()) !== -1) { 4948 return curr; 4949 } 4950 curr = curr.parentNode; 4951 } 4952 return false; 4953 }, 4954 generateSelectorForNode: function (node, strict) { 4955 if(typeof strict === 'undefined') { 4956 strict = true; 4957 } 4958 if (node === null || node.nodeType === 3) { 4959 return false; 4960 } 4961 if (node.nodeName === 'BODY') { 4962 return 'body'; 4963 } 4964 if(mw.tools.hasClass(node, 'edit')){ 4965 var field = node.getAttribute('field'); 4966 var rel = node.getAttribute('rel'); 4967 if(field && rel){ 4968 return '.edit[field="'+field+'"][rel="'+rel+'"]'; 4969 } 4970 } 4971 if(strict && !node.id) { 4972 if(node && node.classList && !node.classList.contains('edit') && mw.tools.isEditable(node)) { 4973 node.id = mw.id('mw-element-'); 4974 } 4975 } 4976 if (!!node.id /*&& node.id.indexOf('element_') === -1*/) { 4977 return '#' + node.id; 4978 } 4979 4980 var filter = function(item) { 4981 return item !== 'changed' 4982 && item !== 'module-over' 4983 && item !== 'mw-bg-mask' 4984 && item !== 'element-current'; 4985 }; 4986 if(node.className && typeof node.className.trim === 'function') { 4987 var _final = node.className.trim() ? '.' + node.className.trim().split(' ').filter(filter).join('.') : node.nodeName.toLocaleLowerCase(); 4988 } else { 4989 var _final = node.nodeName.toLocaleLowerCase(); 4990 } 4991 4992 _final = _final.replace(/\.\./g, '.'); 4993 mw.tools.foreachParents(node, function (loop) { 4994 if (this.id /*&& node.id.indexOf('element_') === -1*/) { 4995 _final = '#' + this.id + ' > ' + _final; 4996 mw.tools.stopLoop(loop); 4997 return false; 4998 } 4999 var n; 5000 if (this && this.className && typeof this.className.trim === 'function') { 5001 n = this.nodeName.toLocaleLowerCase() + '.' + this.className.trim().split(' ').join('.'); 5002 } 5003 else { 5004 n = this.nodeName.toLocaleLowerCase(); 5005 } 5006 _final = n + ' > ' + _final; 5007 }); 5008 return _final 5009 .replace(/.changed/g, '') 5010 .replace(/.element-current/g, '') 5011 .replace(/.module-over/g, ''); 5012 } 5013}; 5014 5015for (var i in domHelp) { 5016 mw.tools[i] = domHelp[i]; 5017} 5018})(); 5019 5020 5021mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/dropdown.js'); 5022 5023mw.tools.dropdown = function (root) { 5024 root = root || document.body; 5025 if (root === null) { 5026 return; 5027 } 5028 5029 var isMobile = ('ontouchstart' in document.documentElement && /mobi/i.test(navigator.userAgent)); 5030 mw.tools.dropdownActivatedBindOnEventsNames = 'mousedown'; 5031 if(isMobile){ 5032 mw.tools.dropdownActivatedBindOnEventsNames = 'mousedown touchstart'; 5033 } 5034 var items = root.querySelectorAll(".mw-dropdown"), l = items.length, i = 0; 5035 for (; i < l; i++) { 5036 var el = items[i]; 5037 var cls = el.className; 5038 if (el.mwDropdownActivated) { 5039 continue; 5040 } 5041 el.mwDropdownActivated = true; 5042 el.hasInput = el.querySelector('input.mw-dropdown-field') !== null; 5043 5044 5045 5046 if (el.hasInput) { 5047 var input = el.querySelector('input.mw-dropdown-field'); 5048 input.dropdown = el; 5049 input.onkeydown = function (e) { 5050 if (e.keyCode === 13) { 5051 e.preventDefault(); 5052 mw.$(this.dropdown).removeClass("active"); 5053 mw.$('.mw-dropdown-content', this.dropdown).hide(); 5054 mw.$(this.dropdown).setDropdownValue(this.value, true, true); 5055 return false;
5056 } 5057 }; 5058 5059 input.onkeyup = function (e) { 5060 if (e.keyCode === 13) { 5061 return false; 5062 } 5063 } 5064 } 5065 mw.$(el).off("click"); 5066 mw.$(el).on("click", function (event) { 5067 if ($(this).hasClass("disabled")) { 5068 return false; 5069 } 5070 if (!mw.tools.hasClass(event.target.className, 'mw-dropdown-content') && !mw.tools.hasClass(event.target.className, 'dd_search')) { 5071 if (this.querySelector('input.mw-dropdown-field') !== null && !mw.tools.hasClass(this, 'active') && mw.tools.hasParentsWithClass(event.target, 'mw-dropdown-value')) { 5072 if (this.hasInput) { 5073 var input = this.querySelector('input.mw-dropdown-field'); 5074 input.value = mw.$(this).getDropdownValue(); 5075 mw.wysiwyg.save_selection(true); 5076 mw.$(input).focus(); 5077 } 5078 } 5079 mw.$(this).toggleClass("active"); 5080 mw.$(".mw-dropdown").not(this).removeClass("active").find(".mw-dropdown-content").hide(); 5081 if (mw.$(".other-action-hover", this).length === 0) { 5082 var item = mw.$(".mw-dropdown-content", this); 5083 if (item.is(":visible")) { 5084 item.hide(); 5085 item.focus(); 5086 } 5087 else { 5088 item.show(); 5089 if (event.target.type !== 'text') { 5090 try { 5091 this.querySelector("input.dd_search").focus(); 5092 } catch (e) { 5093 } 5094 } 5095 } 5096 } 5097 } 5098 }); 5099 mw.$(el) 5100 .hover(function () { 5101 mw.$(this).add(this); 5102 if (mw.tools.hasClass(cls, 'other-action')) { 5103 mw.$(this).addClass('other-action'); 5104 } 5105 }, function () { 5106 mw.$(this).removeClass("hover"); 5107 mw.$(this).removeClass('other-action'); 5108 }) 5109 .on(mw.tools.dropdownActivatedBindOnEventsNames, 'li[value]', function (event) { 5110 mw.$(mw.tools.firstParentWithClass(this, 'mw-dropdown')).setDropdownValue(this.getAttribute('value'), true); 5111 return false; 5112 }) 5113 .on('click', 'a[href="#"]', function (event) { 5114 return false; 5115 }); 5116 } 5117 /* end For loop */ 5118 if (typeof mw.tools.dropdownActivated === 'undefined') { 5119 mw.tools.dropdownActivated = true; 5120 mw.$(document.body).on(mw.tools.dropdownActivatedBindOnEventsNames, function (e) { 5121 if (!mw.tools.hasAnyOfClassesOnNodeOrParent(e.target, ['mw-dropdown-content', 'mw-dropdown'])) { 5122 mw.$(".mw-dropdown").removeClass("active"); 5123 mw.$(".mw-dropdown-content").hide(); 5124 if(self !== top) { 5125 try { 5126 mw.top().$(".mw-dropdown").removeClass("active"); 5127 mw.top().$(".mw-dropdown-content").hide(); 5128 } catch(e){ 5129 5130 } 5131 } 5132 } 5133 }); 5134 } 5135}; 5136 5137 5138mw.dropdown = mw.tools.dropdown; 5139 5140 5141mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/editor.js'); 5142 5143 5144 5145 mw.tools.richtextEditorSettings = { 5146 width: '100%', 5147 height: 'auto', 5148 addControls: false, 5149 hideControls: false, 5150 ready: false 5151 }; 5152 5153 mw.tools.richtextEditor = function (obj) { 5154 if (typeof obj.element === 'string') { 5155 obj.element = mw.$(obj.element)[0]; 5156 } 5157 if (!obj.element || obj.element === undefined) return false; 5158 5159 var o = $.extend({}, mw.tools.richtextEditorSettings, obj); 5160 var frame = document.createElement('iframe'); 5161 frame.richtextEditorSettings = o; 5162 frame.className = 'mw-fullscreen mw-iframe-editor'; 5163 frame.scrolling = 'no'; 5164 var name = 'mw-editor' + mw.random(); 5165 frame.id = name; 5166 frame.name = name; 5167 frame.style.backgroundColor = "white"; 5168 frame.setAttribute('frameborder', 0); 5169 frame.setAttribute('allowtransparency', 'true'); 5170 mw.$(o.element).after(frame); 5171 mw.$(o.element).hide(); 5172 $.get(mw.external_tool('editor_toolbar'), function (a) { 5173 if (frame.contentWindow.document === null) { 5174 return; 5175 } 5176 frame.contentWindow.document.open('text/html', 'replace'); 5177 frame.contentWindow.document.write(a); 5178 frame.contentWindow.document.close(); 5179 frame.contentWindow.editorArea = o.element; 5180 frame.contentWindow.thisFrame = frame; 5181 frame.contentWindow.pauseChange = true; 5182 frame.contentWindow.richtextEditorSettings = o; 5183 5184 frame.onload = function () { 5185 var val = o.element.nodeName !== 'TEXTAREA' ? o.element.innerHTML : o.element.value 5186 frame.contentWindow.document.getElementById('editor-area').innerHTML = val; 5187 if (!!o.hideControls && o.hideControls.constructor === [].constructor) { 5188 var l = o.hideControls.length, i = 0; 5189 for (; i < l; i++) { 5190 mw.$('.mw_editor_' + o.hideControls[i], frame.contentWindow.document).hide(); 5191 } 5192 }
5193 if (!!o.addControls && (typeof o.addControls === 'string' || typeof o.addControls === 'function' || !!o.addControls.nodeType)) { 5194 mw.$('.editor_wrapper', frame.contentWindow.document).append(o.addControls); 5195 } 5196 frame.api = frame.contentWindow.mw.wysiwyg; 5197 if (typeof o.ready === 'function') { 5198 o.ready.call(frame, frame.contentWindow.document); 5199 } 5200 setTimeout(function () { 5201 if (frame.contentWindow) { 5202 frame.contentWindow.pauseChange = false; 5203 } 5204 5205 }, frame.contentWindow.SetValueTime); 5206 mw.$(obj.element).on('sourceChanged', function(e, val){ 5207 frame.contentWindow.document.getElementById('editor-area').innerHTML = val; 5208 }) 5209 mw.$(frame.contentWindow.document.getElementById('editor-area')).on('keyup paste change', function(){ 5210 if (frame.richtextEditorSettings.element.nodeName !== 'TEXTAREA') { 5211 frame.richtextEditorSettings.element.innerHTML = this.innerHTML 5212 } else { 5213 frame.richtextEditorSettings.element.value = this.innerHTML; 5214 } 5215 }) 5216 frame.contentWindow.mw.tools.createStyle(undefined, '#editor-area{' + (obj.style || '') + '}'); 5217 } 5218 mw.$(obj.element).on('sourceChanged', function (e, val) { 5219 frame.contentWindow.document.getElementById('editor-area').innerHTML = val; 5220 }); 5221 5222 }); 5223 o.width = o.width != 'auto' ? o.width : '100%'; 5224 mw.$(frame).css({width: o.width, height: o.height}); 5225 if(o.height === 'auto') { 5226 mw.tools.iframeAutoHeight(frame); 5227 } 5228 frame.setValue = function (val) { 5229 frame.contentWindow.pauseChange = true; 5230 frame.contentWindow.document.getElementById('editor-area').innerHTML = val; 5231 if (frame.richtextEditorSettings.element.nodeName !== 'TEXTAREA') { 5232 frame.richtextEditorSettings.element.innerHTML = val 5233 } 5234 else { 5235 frame.richtextEditorSettings.element.value = val; 5236 } 5237 frame.value = val; 5238 frame.contentWindow.pauseChange = false; 5239 } 5240 return frame; 5241 } 5242 5243 mw.editor = mw.tools.richtextEditor; 5244 5245 5246mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/element.js'); 5247 5248(function(){ 5249 5250 var MWElement = function(options, root){ 5251 var scope = this; 5252 5253 5254 this.toggle = function () { 5255 this.css('display', this.css('display') === 'none' ? 'block' : 'none'); 5256 }; 5257 5258 this._active = function () { 5259 return this.nodes[this.nodes.length - 1]; 5260 }; 5261 5262 this.getDocument = function () { 5263 return this._active().ownerDocument; 5264 } 5265 5266 this.getWindow = function () { 5267 return this.getDocument().defaultView;; 5268 } 5269 5270 this.get = function(selector, scope){ 5271 this.nodes = (scope || document).querySelectorAll(selector); 5272 }; 5273 5274 this.each = function(cb){ 5275 if(this.nodes) { 5276 for (var i = 0; i < this.nodes.length; i++) { 5277 cb.call(this.nodes[i], i); 5278 } 5279 } else if(this.node) { 5280 cb.call(this.node, 0); 5281 } 5282 return this; 5283 }; 5284 5285 this.scrollTop = function (val) { 5286 if(typeof val === 'undefined') { 5287 return this._active().scrollTop; 5288 } 5289 return this.each(function(){ 5290 this.scrollTop = val; 5291 }); 5292 }; 5293 5294 this.encapsulate = function () { 5295 5296 }; 5297 5298 this.create = function() { 5299 var _options = {}; 5300 if(this.settings.is) { 5301 _options.is = this.settings.is; 5302 } 5303 5304 var el = this.document.createElement(this.settings.tag, _options); 5305 this.node = el; 5306 5307 /*if (this.settings.encapsulate) { 5308 var mode = this.settings.encapsulate === true ? 'open' : this.settings.encapsulate; 5309 el.attachShadow({ 5310 mode: mode 5311 }); 5312 }*/ 5313 5314 this.nodes = [el]; 5315 if (this.settings.content) { 5316 if (Array.isArray(this.settings.content)) { 5317 this.settings.content.forEach(function (el){ 5318 if(Object.getPrototypeOf(el) === Object.prototype) { 5319 scope.append(new MWElement(el)); 5320 } else { 5321 scope.append(el); 5322 } 5323 }); 5324 } else if(this.settings.content instanceof MWElement) { 5325 this.append(this.settings.content); 5326 } else if(typeof this.settings.content === 'object') { 5327 this.append(new MWElement(this.settings.content)); 5328 } else if(typeof this.settings.content === 'string') { 5329 this.get(0).innerHTML = (this.settings.content); 5330 } 5331 } 5332 this.$node = $(el); 5333 }; 5334 5335 this._specialProps = function(dt, val){ 5336 if(dt === 'tooltip') { 5337 this.node.dataset[dt] = val; 5338 return true; 5339 } 5340 }; 5341 5342 this.setProps = function(){ 5343 for(var i in this.settings.props) { 5344 if (i === 'dataset') { 5345 for(var dt in this.settings.props[i]) { 5346 this.node.dataset[dt] = this.settings.props[i][dt]; 5347 } 5348 } else if (i === 'style') { 5349 for(var st in this.settings.props[i]) { 5350 this.node.style[st] = this.settings.props[i][st]; 5351 } 5352 } else { 5353 var val = this.settings.props[i]; 5354 if(!this._specialProps(i, val)) { 5355 this.node[i] = val; 5356 } 5357 } 5358 } 5359 }; 5360 5361 this.__ = { 5362 cssNumber: [ 5363 'animationIterationCount', 5364 'columnCount', 5365 'fillOpacity', 5366 'flexGrow', 5367 'flexShrink', 5368 'fontWeight', 5369 'gridArea', 5370 'gridColumn', 5371 'gridColumnEnd', 5372 'gridColumnStart', 5373 'gridRow', 5374 'gridRowEnd', 5375 'gridRowStart', 5376 'lineHeight', 5377 'opacity', 5378 'order', 5379 'orphans', 5380 'widows', 5381 'zIndex', 5382 'zoom' 5383 ] 5384 }; 5385 5386 this._normalizeCSSValue = function (prop, val) { 5387 if(typeof val === 'number') { 5388 if(this.__.cssNumber.indexOf(prop) === -1) { 5389 val = val + 'px'; 5390 } 5391 } 5392 return val; 5393 }; 5394 5395 this.css = function(css, val){ 5396 if(typeof css === 'string') { 5397 if(typeof val !== 'undefined'){ 5398 var nval = this._normalizeCSSValue(css, val); 5399 this.each(function (){ 5400 this.style[css] = nval; 5401 }); 5402 } else { 5403 return this.document.defaultView.getComputedStyle(this.node)[css]; 5404 } 5405 } 5406 if(typeof css === 'object') { 5407 for (var i in css) { 5408 5409 this.each(function (){ 5410 this.style[i] = scope._normalizeCSSValue(i, css[i]); 5411 }); 5412 } 5413 } 5414 return this; 5415 }; 5416 5417 this.dataset = function(prop, val){ 5418 if(typeof val === 'undefined') { 5419 return this._active()[prop]; 5420 } 5421 this.each(function (){ 5422 this.dataset[prop] = val; 5423 }); 5424 return this; 5425 }; 5426 5427 this.attr = function(prop, val){ 5428 if(typeof val === 'undefined') { 5429 return this._active()[prop]; 5430 } 5431 this.each(function (){ 5432 this.setAttribute(prop, val); 5433 }); 5434 return this; 5435 }; 5436 5437 this.focus = function(){ 5438 this._active().focus() 5439 return this; 5440 }; 5441 5442 this.val = function(val){ 5443 if(typeof val === 'undefined') { 5444 return this._active().value; 5445 } 5446 this.each(function (){ 5447 this.value = val; 5448 }); 5449 return this; 5450 }; 5451 5452 this.prop = function(prop, val){ 5453 var active = this._active(); 5454 if(!active) { 5455 return; 5456 } 5457 if(typeof val === 'undefined') { 5458 return active[prop]; 5459 } 5460 if(active[prop] !== val){ 5461 active[prop] = val; 5462 this.trigger('propChange', [prop, val]); 5463 } 5464 return this; 5465 }; 5466 5467 this.hide = function () { 5468 return this.each(function (){ 5469 this.style.display = 'none'; 5470 }); 5471 }; 5472 this.show = function () { 5473 return this.each(function (){ 5474 this.style.display = ''; 5475 }); 5476 }; 5477 5478 this.find = function (sel) {
5479 var el = mw.element('#r' + new Date().getTime()); 5480 this.each(function (){ 5481 var all = this.querySelectorAll(sel); 5482 for(var i = 0; i < all.length; i++) { 5483 if(el.nodes.indexOf(all[i]) === -1) { 5484 el.nodes.push(all[i]); 5485 } 5486 } 5487 }); 5488 return el; 5489 }; 5490 5491 var prepareClasses = function () { 5492 var classes = []; 5493 Array.from(arguments).forEach(function (arg){ 5494 Array.from(arg).forEach(function (arg){ 5495 var arr; 5496 if(Array.isArray(arg)) { 5497 arr = arg; 5498 } else { 5499 arr = arg.split(' '); 5500 } 5501 arr.forEach(function (cls){ 5502 cls = cls.trim(); 5503 if(!!cls) { 5504 classes.push(cls); 5505 } 5506 }); 5507 }); 5508 }); 5509 return classes; 5510 } 5511 5512 this.hasClass = function (c) { 5513 var active = this._active(); 5514 if(active) { 5515 return active.classList.contains(c); 5516 } 5517 return false; 5518 } 5519 5520 this.addClass = function () { 5521 var classes = prepareClasses(arguments) 5522 return this.each(function (){ 5523 var node = this; 5524 classes.forEach(function (cls){ 5525 node.classList.add(cls); 5526 }); 5527 }); 5528 }; 5529 5530 this.toggleClass = function () { 5531 var classes = prepareClasses(arguments) 5532 return this.each(function (){ 5533 var node = this; 5534 classes.forEach(function (cls){ 5535 node.classList.toggle(cls); 5536 }); 5537 }); 5538 }; 5539 5540 this.removeClass = function () { 5541 var classes = prepareClasses(arguments) 5542 return this.each(function (){ 5543 var node = this; 5544 classes.forEach(function (cls){ 5545 node.classList.remove(cls); 5546 }); 5547 }); 5548 }; 5549 5550 this.remove = function () { 5551 return this.each(function (){ 5552 this.remove(); 5553 }); 5554 }; 5555 5556 this.empty = function () { 5557 return this.html(''); 5558 }; 5559 5560 this.html = function (val) { 5561 if (typeof val === 'undefined') { 5562 return this._active().innerHTML; 5563 } 5564 return this.each(function (){ 5565 this.innerHTML = val; 5566 }); 5567 }; 5568 this.text = function (val, clean) { 5569 if(typeof val === 'undefined') { 5570 return this.node.textContent; 5571 } 5572 if(typeof clean === 'undefined') { 5573 clean = true; 5574 } 5575 if (clean) { 5576 val = this.document.createRange().createContextualFragment(val).textContent; 5577 } 5578 // this.node.innerHTML = val; 5579 return this.each(function (){ 5580 this.textContent = val; 5581 }); 5582 }; 5583 5584 this._asdom = function (obj) { 5585 if (typeof obj === 'string') { 5586 return this.document.createRange().createContextualFragment(obj); 5587 } else if (obj.node){ 5588 return obj.node; 5589 } 5590 else if (obj.nodes){ 5591 return obj.nodes[obj.nodes.length - 1]; 5592 } else { 5593 return obj; 5594 } 5595 }; 5596 5597 this.offset = function () { 5598 if(this._active()) { 5599 5600 var win = this.getWindow(); 5601 var rect = this._active().getBoundingClientRect(); 5602 rect.offsetTop = rect.top + win.pageYOffset; 5603 rect.offsetBottom = rect.bottom + win.pageYOffset; 5604 rect.offsetLeft = rect.left + win.pageXOffset; 5605 return rect; 5606 } 5607 }; 5608 5609 5610 this.width = function (val) { 5611 if(val) { 5612 return this.css('width', val); 5613 } 5614 return this._active().offsetWidth; 5615 }; 5616 5617 this.height = function (val) { 5618 if(val) { 5619 return this.css('height', val); 5620 } 5621 return this._active().offsetHeight; 5622 }; 5623 5624 this.parent = function () {
5625 return mw.element(this._active().parentNode); 5626 }; 5627 5628 this.next = function () { 5629 return mw.element(this._active().nextElementSibling); 5630 }; 5631 this.prev = function () { 5632 return mw.element(this._active().previousElementSibling); 5633 }; 5634 5635 5636 this.parents = function (selector) { 5637 selector = selector || '*'; 5638 var el = this._active(); 5639 var curr = el.parentElement; 5640 var res = mw.element(); 5641 res.nodes = [] 5642 while (curr) { 5643 if(curr.matches(selector)) { 5644 res.nodes.push(curr); 5645 } 5646 curr = curr.parentElement; 5647 } 5648 return res; 5649 }; 5650 this.append = function (el) { 5651 if (el) { 5652 this.each(function (){ 5653 this.append(scope._asdom(el)); 5654 }); 5655 } 5656 return this; 5657 }; 5658 5659 this.before = function (el) { 5660 if (el) { 5661 this.each(function (){ 5662 if(this.parentNode){ 5663 this.parentNode.insertBefore(scope._asdom(el), this); 5664 } 5665 }); 5666 } 5667 return this; 5668 }; 5669 5670 this.after = function (el) { 5671 if (el) { 5672 this.each(function (){ 5673 if(this.parentNode) { 5674 this.parentNode.insertBefore(scope._asdom(el), this.nextSibling); 5675 } 5676 }); 5677 } 5678 }; 5679 5680 this.prepend = function (el) { 5681 if (el) { 5682 this.each(function (){ 5683 this.prepend(scope._asdom(el)); 5684 }); 5685 } 5686 return this; 5687 }; 5688 this._disabled = false; 5689 5690 Object.defineProperty(this, "disabled", { 5691 get : function () { return this._disabled; }, 5692 set : function (value) { 5693 this._disabled = value; 5694 this.node.disabled = this._disabled; 5695 this.node.dataset.disabled = this._disabled; 5696 } 5697 }); 5698 5699 this.trigger = function(event, data){ 5700 data = data || {}; 5701 this.each(function (){ 5702 this.dispatchEvent(new CustomEvent(event, { 5703 detail: data, 5704 cancelable: true, 5705 bubbles: true 5706 })); 5707 if(scope._on[event]) { 5708 scope._on[event].forEach(function(cb){ 5709 cb.call(this, event, data); 5710 }); 5711 } 5712 }); 5713 return this; 5714 }; 5715 5716 this.get = function (i) { 5717 return this.nodes[i]; 5718 }; 5719 5720 this._on = {}; 5721 this.on = function(events, cb){ 5722 events = events.trim().split(' '); 5723 events.forEach(function (ev) { 5724 if(!scope._on[ev]) { scope._on[ev] = []; } 5725 scope._on[ev].push(cb); 5726 scope.each(function (){ 5727 /*this.addEventListener(ev, function(e) { 5728 cb.call(scope, e, e.detail, this); 5729 }, false);*/ 5730 this.addEventListener(ev, cb, false); 5731 }); 5732 }); 5733 return this; 5734 }; 5735 this.init = function(){ 5736 this.nodes = []; 5737 var _root = root || document; 5738 if(_root.get) { 5739 _root = _root.get(0); 5740 } 5741 this.root = _root; 5742 this._asElement = false; 5743 this.document = (this.root.body ? this.root : this.root.ownerDocument); 5744 5745 options = options || {}; 5746 5747 if(options.nodeName && options.nodeType) { 5748 this.nodes.push(options); 5749 this.node = (options); 5750 options = {}; 5751 this._asElement = true; 5752 } else if(typeof options === 'string') { 5753 if(options.indexOf('<') === -1) { 5754 this.nodes = Array.prototype.slice.call(this.root.querySelectorAll(
5754options)); 5755 options = {}; 5756 this._asElement = true; 5757 } else { 5758 var el = this._asdom(options); 5759 5760 this.nodes = [].slice.call(el.children); 5761 this._asElement = true; 5762 } 5763 } 5764 5765 options = options || {}; 5766 5767 var defaults = { 5768 tag: 'div', 5769 props: {} 5770 }; 5771 5772 this.settings = $.extend({}, defaults, options); 5773 5774 if(this._asElement) return; 5775 this.create(); 5776 this.setProps(); 5777 }; 5778 this.init(); 5779 }; 5780 mw.element = function(options, root){ 5781 return new MWElement(options, root); 5782 }; 5783 mw.element.module = function (name, func) { 5784 MWElement.prototype[name] = func; 5785 }; 5786 5787})(); 5788 5789 5790mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/elementedit.js'); 5791 5792mw.tools.elementEdit = function (el, textonly, callback, fieldClass) { 5793 if (!el || el.querySelector('.mw-live-edit-input') !== null) { 5794 return; 5795 } 5796 textonly = (typeof textonly === 'undefined') ? true : textonly; 5797 var input = document.createElement('span'); 5798 input.className = (fieldClass || "") + ' mw-live-edit-input mw-liveedit-field'; 5799 input.contentEditable = true; 5800 var $input = $(input); 5801 if (textonly === true) { 5802 input.innerHTML = el.textContent; 5803 input.onblur = function () { 5804 var val = $input.text(); 5805 var ischanged = true; 5806 setTimeout(function () { 5807 mw.$(el).text(val); 5808 if (typeof callback === 'function' && ischanged) { 5809 callback.call(val, el); 5810 } 5811 }, 3); 5812 }; 5813 input.onkeydown = function (e) { 5814 if (e.keyCode === 13) { 5815 e.preventDefault(); 5816 mw.$(el).text($input.text()); 5817 if (typeof callback === 'function') { 5818 callback.call($input.text(), el); 5819 } 5820 return false; 5821 } 5822 } 5823 } 5824 else { 5825 input.innerHTML = el.innerHTML; 5826 input.onblur = function () { 5827 var val = this.innerHTML; 5828 var ischanged = this.changed === true; 5829 setTimeout(function () { 5830 el.innerHTML = val; 5831 if (typeof callback === 'function' && ischanged) { 5832 callback.call(val, el); 5833 } 5834 }, 3) 5835 } 5836 input.onkeydown = function (e) { 5837 if (e.keyCode === 13) { 5838 e.preventDefault(); 5839 var val = this.innerHTML; 5840 el.innerHTML = val; 5841 if (typeof callback === 'function') { 5842 callback.call(val, el); 5843 } 5844 return false; 5845 } 5846 } 5847 } 5848 mw.$(el).empty().append(input); 5849 $input.focus(); 5850 input.changed = false; 5851 $input.change(function () { 5852 this.changed = true; 5853 }); 5854 return input; 5855} 5856 5857 5858mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/external.js'); 5859 5860 mw.tools.externalInstrument = { 5861 register: {}, 5862 holder: function () { 5863 var div = document.createElement('div'); 5864 div.className = 'mw-external-tool'; 5865 return div; 5866 }, 5867 prepare: function (name, params) { 5868 var frame = document.createElement('iframe'); 5869 frame.name = name; 5870 /* for callbacks */ 5871 var url = mw.external_tool(name); 5872 if (typeof params === 'object') { 5873 params = $.param(params); 5874 } 5875 else { 5876 params = ""; 5877 } 5878 frame.src = url + "?" + params; 5879 frame.scrolling = 'no'; 5880 frame.frameBorder = 0; 5881 frame.onload = function () { 5882 frame.contentWindow.thisframe = frame; 5883 }; 5884 return frame; 5885 }, 5886 init: function (name, callback, holder, params) { 5887 if (typeof mw.tools.externalInstrument.register[name] === 'undefined') { 5888 var frame = mw.tools.externalInstrument.prepare(name, params); 5889 frame.height = 300; 5890 mw.tools.externalInstrument.register[name] = frame; 5891 if (!holder) { 5892 holder = mw.tools.externalInstrument.holder(); 5893 mw.$(document.body).append(holder); 5894 } 5895 mw.$(holder).append(frame); 5896 } 5897 else { 5898 mw.$(mw.tools.externalInstrument.register[name]).unbind('change'); 5899 } 5900 mw.$(mw.tools.externalInstrument.register[name]).bind('change', function () { 5901 Array.prototype.shift.apply(arguments); 5902 callback.apply(this, arguments); 5903 }); 5904 return mw.tools.externalInstrument.register[name]; 5905 } 5906 }; 5907 5908 mw.tools.external = function (name, callback, holder, params) { 5909 return mw.tools.externalInstrument.init(name, callback, holder, params); 5910 }; 5911 5912 mw.tools._external = function (o) { 5913 return mw.tools.external(o.name, o.callback, o.holder, o.params); 5914 }; 5915 5916 5917 5918mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/extradata-form.js'); 5919 5920mw.getExtradataFormData = function (data, call) { 5921 5922 if (data.form_data_required) { 5923 if (!data.form_data_module_params) { 5924 data.form_data_module_params = {}; 5925 } 5926 data.form_data_module_params._confirm = 1 5927 } 5928 5929 5930 if (data.form_data_required_params) { 5931 data.form_data_module_params = $.extend({}, data.form_data_required_params,data.form_data_module_params); 5932 } 5933 5934 if (data.form_data_module) { 5935 mw.loadModuleData(data.form_data_module, function (moduledata) { 5936 call.call(undefined, moduledata); 5937 }, null, data.form_data_module_params); 5938 } 5939 else { 5940 call.call(undefined, data.form_data_required); 5941 } 5942} 5943 5944mw.extradataForm = function (options, data, func) { 5945 if (options._success) { 5946 options.success = options._success; 5947 delete options._success; 5948 } 5949 mw.getExtradataFormData(data, function (extra_html) { 5950 var form = document.createElement('form'); 5951 mw.$(form).append(extra_html); 5952 5953 if(data.form_data_required){ 5954 mw.$(form).append('<hr><button type="submit" class="mw-ui-btn pull-right mw-ui-btn-invert">
5954' + mw.lang('Submit') + '</button>'); 5955 } 5956 5957 5958 5959 form.action = options.url; 5960 form.method = options.type; 5961 form.__modal = mw.dialog({ 5962 content: form, 5963 title: data.error, 5964 closeButton: false, 5965 closeOnEscape: false 5966 }); 5967 mw.$('script', form).each(function() { 5968 eval($(this).text()); 5969 }); 5970 5971 $(form.__modal).on('closedByUser', function () { 5972 if(options.onExternalDataDialogClose) { 5973 options.onExternalDataDialogClose.call(); 5974 } 5975 }); 5976 5977 5978 5979 if(data.form_data_required) { 5980 mw.$(form).on('submit', function (e) { 5981 e.preventDefault(); 5982 var when = form.$beforepost ? form.$beforepost : function () {}; 5983 $.when(when()).then(function() { 5984 var exdata = mw.serializeFields(form); 5985 if(typeof options.data === 'string'){ 5986 var params = {}; 5987 options.data.split('&').forEach(function(a){ 5988 var c = a.split('='); 5989 params[c[0]] = decodeURIComponent(c[1]); 5990 }); 5991 options.data = params; 5992 } 5993 var isFormData = options.data.constructor.name === 'FormData'; 5994 if(isFormData) { 5995 for (var i in exdata) { 5996 options.data.set(i, exdata[i]); 5997 } 5998 5999 } else { 6000 for (var i in exdata) { 6001 options.data[i] = exdata[i]; 6002 } 6003 } 6004 if(func) { 6005 func(options); 6006 6007 } else { 6008 mw.ajax(options); 6009 6010 } 6011 form.__modal.remove(); 6012 }) 6013 6014 6015 6016 }); 6017 } 6018 }); 6019}; 6020 6021 6022mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/fullscreen.js'); 6023 6024(function(expose){ 6025 var fullscreen = { 6026 fullscreen: function (el) { 6027 if (el.requestFullScreen) { 6028 el.requestFullScreen(); 6029 } 6030 else if (el.webkitRequestFullScreen) { 6031 el.webkitRequestFullScreen(); 6032 } 6033 else if (el.mozRequestFullScreen) { 6034 el.mozRequestFullScreen(); 6035 } 6036 else if (el.msRequestFullscreen) { 6037 el.msRequestFullscreen(); 6038 } 6039 }, 6040 isFullscreenAvailable: function () { 6041 var b = document.body; 6042 return 'requestFullScreen' in b || 'webkitRequestFullScreen' in b || 'mozRequestFullScreen' in b || 'msRequestFullscreen' in b || false; 6043 }, 6044 cancelFullscreen: function () { 6045 if (document.exitFullscreen) { 6046 document.exitFullscreen(); 6047 } 6048 else if (document.mozCancelFullScreen) { 6049 document.mozCancelFullScreen(); 6050 } 6051 else if (document.webkitExitFullscreen) { 6052 document.webkitExitFullscreen(); 6053 } 6054 else if (document.msExitFullscreen) { 6055 document.msExitFullscreen(); 6056 } 6057 }, 6058 toggleFullscreen: function (el) { 6059 var infullscreen = document.fullScreen || document.webkitIsFullScreen || document.mozFullScreen || false; 6060 if (infullscreen) { 6061 mw.tools.cancelFullscreen(); 6062 } 6063 else { 6064 mw.tools.fullscreen(el) 6065 } 6066 }, 6067 fullscreenChange: function (c) { 6068 if ('addEventListener' in document) { 6069 document.addEventListener("fullscreenchange", function () { 6070 c.call(document.fullscreen); 6071 }, false); 6072 document.addEventListener("mozfullscreenchange", function () { 6073 c.call(document.mozFullScreen); 6074 }, false); 6075 document.addEventListener("webkitfullscreenchange", function () { 6076 c.call(document.webkitIsFullScreen); 6077 }, false); 6078 } 6079 } 6080 }; 6081 Object.assign(expose, fullscreen); 6082 6083})(mw.tools); 6084 6085 6086mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/gallery.js'); 6087 6088(function(){ 6089 6090 6091 var Gallery = function (array, startFrom) { 6092 startFrom = startFrom || 0; 6093 6094 this.currentIndex = startFrom; 6095 6096 this.data = array; 6097 var scope = this; 6098 6099 this._template = function () { 6100 var el = document.createElement('div'); 6101 el.className = 'mw-gallery'; 6102 el.innerHTML = '' + 6103 '<div class="">' + 6104 '<div class="mw-gallery-overlay"></div>' + 6105 '<div class="mw-gallery-content"></div>' + 6106 '<div class="mw-gallery-prev"></div>' + 6107 '<div class="mw-gallery-next"></div>' + 6108 '<div class="mw-gallery-controls">' + 6109 '<span class="mw-gallery-control-play"></span>' + 6110 /*'<span class="mw-gallery-control-fullscreen"></span>' +*/ 6111 '<span class="mw-gallery-control-close"></span>' + 6112 '</div>' + 6113 '</div>'; 6114 return el; 6115 }; 6116 6117 this.createSingle = function (item, i) { 6118 var el = document.createElement('div'); 6119 el.className = 'mw-gallery-fullscreen-item mw-gallery-item-' + i + (startFrom === i ? ' active' : ''); 6120 var desc = !item.description ? '' : '<div class="mw-gallery-item-description"><div class="mw-gallery-item-description-content">'+item.description+'</div></div>'; 6121 el.innerHTML = '<div class="mw-gallery-item-image"><img src="'+(item.image || item.url || item.src || item.filename)+'"></div>' + desc; 6122 this.container.appendChild(el); 6123 return el; 6124 }; 6125 6126 this.next = function () { 6127 this.currentIndex++; 6128 if(!this._items[this.currentIndex]) { 6129 this.currentIndex = 0; 6130 } 6131 this.goto(this.currentIndex); 6132 }; 6133 6134 this.prev = function () { 6135 this.currentIndex--; 6136 if(!this._items[this.currentIndex]) { 6137 this.currentIndex = this._items.length - 1; 6138 } 6139 this.goto(this.currentIndex); 6140 }; 6141 6142 this.goto = function (i) { 6143 if(i > -1 && i < this._items.length) { 6144 this.currentIndex = i;
6145 this._items.forEach(function (item, i){ 6146 item.classList.remove('active'); 6147 if(i === scope.currentIndex) { 6148 item.classList.add('active'); 6149 } 6150 }); 6151 } 6152 }; 6153 6154 this.paused = true; 6155 6156 this.pause = function () { 6157 this.paused = true; 6158 clearTimeout(this.playInterval); 6159 mw.tools.loading(this.template, false, ); 6160 }; 6161 6162 this.playInterval = null; 6163 this._play = function () { 6164 if(this.paused) return; 6165 mw.tools.loading(this.template, 100, 'slow'); 6166 this.playInterval = setTimeout(function (){ 6167 mw.tools.loading(scope.template, 'hide'); 6168 scope.next(); 6169 scope._play(); 6170 },5000); 6171 }; 6172 6173 this.play = function () { 6174 this.next(); 6175 this.paused = false; 6176 this._play(); 6177 }; 6178 6179 this._items = []; 6180 6181 this.createHandles = function () { 6182 this.template.querySelector('.mw-gallery-prev').onclick = function (){ scope.pause(); scope.prev(); }; 6183 this.template.querySelector('.mw-gallery-next').onclick = function (){ scope.pause(); scope.next(); }; 6184 this.template.querySelector('.mw-gallery-control-close').onclick = function (){ scope.remove(); }; 6185 this.template.querySelector('.mw-gallery-control-play').onclick = function (){ 6186 scope[scope.paused ? 'play' : 'pause'](); 6187 this.classList[scope.paused ? 'remove' : 'add']('pause'); 6188 }; 6189 }; 6190 6191 this.createItems = function () { 6192 this.data.forEach(function (item, i ){ 6193 scope._items.push(scope.createSingle(item, i)); 6194 }); 6195 }; 6196 6197 this.init = function () { 6198 this.template = this._template(); 6199 document.body.appendChild(this.template); 6200 this.container = this.template.querySelector('.mw-gallery-content'); 6201 this.createItems(); 6202 this.createHandles(); 6203 }; 6204 6205 this.remove = function () { 6206 this.template.remove(); 6207 }; 6208 6209 this.init(); 6210 }; 6211 6212 mw.gallery = function (array, startFrom){ 6213 return new Gallery(array, startFrom); 6214 }; 6215 6216 // obsolate: 6217 mw.tools.gallery = { 6218 init: mw.gallery 6219 }; 6220})(); 6221 6222 6223mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/helpers.js'); 6224 6225;(function(expose){ 6226 var helpers = { 6227 fragment: function(){ 6228 if(!this._fragment){ 6229 this._fragment = document.createElement('div'); 6230 this._fragment.style.visibility = 'hidden'; 6231 this._fragment.style.position = 'absolute'; 6232 this._fragment.style.width = '1px'; 6233 this._fragment.style.height = '1px'; 6234 document.body.appendChild(this._fragment); 6235 } 6236 return this._fragment; 6237 }, 6238 _isBlockCache:{}, 6239 isBlockLevel:function(node){ 6240 if(!node || node.nodeType === 3){ 6241 return false; 6242 } 6243 const blockLike = ['flex', 'block', 'grid', 'table', 'list-item', 'table-row', 'table-cell', 'table-row-group', 'table-header-group', 'table-footer-group', 'table-column-group', 'table-column', 'table-caption', 'table-cell', 'table-row', 'inline-block', 'inline-table', 'inline-flex', 'inline-grid', 'flow-root', 'grid', 'grid-item', 'grid-line', 'grid-row', 'grid-column', 'grid-area', 'grid-auto-rows', 'grid-auto-columns', 'grid-template-rows', 'grid-template-columns', 'grid-template-areas', 'grid-template', 'grid-auto-flow', 'grid-row-gap', 'grid-column-gap', 'grid-gap', 'grid-row-start', 'grid-row-end', 'grid-column-start', 'grid-column-end', 'grid-area']; 6244 return blockLike.indexOf(getComputedStyle(node).display) !== -1; 6245 }, 6246 _isInlineCache:{}, 6247 isInlineLevel:function(node){ 6248 if(node.nodeType === 3){ 6249 return false; 6250 } 6251 var name = node.nodeName; 6252 if(typeof this._isInlineCache[name] !== 'undefined'){ 6253 return this._isInlineCache[name]; 6254 } 6255 var test = document.createElement(name); 6256 this.fragment().appendChild(test); 6257 this._isInlineCache[name] = getComputedStyle(test).display === 'inline' && node.nodeName !== 'BR'; 6258 this.fragment().removeChild(test); 6259 return this._isInlineCache[name]; 6260 }, 6261 elementOptions: function(el) { 6262 var opt = ( el.dataset.options || '').trim().split(','), final = {}; 6263 if(!opt[0]) return final; 6264 $.each(opt, function(){ 6265 var arr = this.split(':'); 6266 var val = arr[1].trim(); 6267 if(!val){ 6268 6269 } 6270 else if(val === 'true' || val === 'false'){ 6271 val = val === 'true'; 6272 } 6273 else if(!/\D/.test(val)){ 6274 val = parseInt(val, 10); 6275 } 6276 final[arr[0].trim()] = val; 6277 }); 6278 return final; 6279 }, 6280 createAutoHeight: function() { 6281 if(window.thismodal && thismodal.iframe) { 6282 mw.tools.iframeAutoHeight(thismodal.iframe, 'now'); 6283 } 6284 else if(mw.top().win.frameElement && mw.top().win.frameElement.contentWindow === window) { 6285 mw.tools.iframeAutoHeight(mw.top().win.frameElement, 'n
6285ow'); 6286 } else if(window.top !== window) { 6287 mw.top().$('iframe').each(function(){ 6288 try{ 6289 if(this.contentWindow === window) { 6290 mw.tools.iframeAutoHeight(this, 'now'); 6291 } 6292 } catch(e){} 6293 }) 6294 } 6295 }, 6296 collision: function(el1, el2){ 6297 if(!el1 || !el2) return; 6298 el1 = mw.$(el1); 6299 el2 = mw.$(el2); 6300 var o1 = el1.offset(); 6301 var o2 = el2.offset(); 6302 o1.width = el1.width(); 6303 o1.height = el1.height(); 6304 o2.width = el2.width(); 6305 o2.height = el2.height(); 6306 return (o1.left < o2.left + o2.width && o1.left + o1.width > o2.left && o1.top < o2.top + o2.height && o1.top + o1.height > o2.top); 6307 }, 6308 distance: function (x1, y1, x2, y2) { 6309 var a = x1 - x2; 6310 var b = y1 - y2; 6311 return Math.floor(Math.sqrt(a * a + b * b)); 6312 }, 6313 copy: function (value) { 6314 var tempInput = document.createElement("textarea"); 6315 tempInput.style = "position: absolute; left: -1000px; top: -1000px"; 6316 tempInput.value = value; 6317 document.body.appendChild(tempInput); 6318 tempInput.select(); 6319 document.execCommand("copy"); 6320 document.body.removeChild(tempInput); 6321 mw.notification.success(mw.lang('Copied') + ': "' + value + '"'); 6322 }, 6323 cloneObject: function (object) { 6324 return jQuery.extend(true, {}, object); 6325 }, 6326 constructions: function () { 6327 mw.$(".mw-image-holder").each(function () { 6328 var img = this.querySelector('img'); 6329 if (img && img.src) { 6330 mw.$(this).css('backgroundImage', 'url(' + img.src + ')'); 6331 } 6332 }); 6333 }, 6334 isRtl: function (el) { 6335 //todo 6336 el = el || document.documentElement; 6337 return document.documentElement.dir === 'rtl'; 6338 }, 6339 isEditable: function (item) { 6340 var el = item; 6341 if (!!item.type && !!item.target) { 6342 el = item.target; 6343 } 6344 6345 return mw.tools.parentsOrCurrentOrderMatchOrOnlyFirst(el, ['edit', 'module']) 6346 && mw.tools.parentsOrCurrentOrderMatchOrOnlyFirst(el, ['edit', 'noedit']); 6347 }, 6348 eachIframe: function (callback, root, ignore) { 6349 root = root || document; 6350 var scope = this; 6351 ignore = ignore || []; 6352 var all = root.querySelectorAll('iframe'), i = 0; 6353 for (; i < all.length; i++) { 6354 if (mw.tools.canAccessIFrame(all[i]) && ignore.indexOf(all[i]) === -1) { 6355 callback.call(all[i].contentWindow, all[i].contentWindow); 6356 scope.eachIframe(callback, all[i].contentWindow.document); 6357 } 6358 } 6359 }, 6360 eachWindow: function (callback, options) { 6361 options = options || {}; 6362 var curr = window; 6363 callback.call(curr, curr); 6364 while (curr !== top) { 6365 if(curr.parent && curr.parent.document) { 6366 this.eachIframe(function (iframeWindow) { 6367 callback.call(iframeWindow, iframeWindow); 6368 }, curr.parent.document, [curr]); 6369 curr = curr.parent; 6370 callback.call(curr, curr); 6371 } 6372 } 6373 this.eachIframe(function (iframeWindow) { 6374 callback.call(iframeWindow, iframeWindow); 6375 }); 6376 if (window.opener !== null && mw.tools.canAccessWindow(opener)) { 6377 callback.call(window.opener, window.opener); 6378 this.eachIframe(function (iframeWindow) { 6379 callback.call(iframeWindow, iframeWindow); 6380 }, window.opener.document); 6381 } 6382 }, 6383 canAccessWindow: function (winObject) { 6384 var can = false;
6385 try { 6386 var doc = winObject.document; 6387 can = !!doc.body; 6388 } catch (err) { 6389 } 6390 return can; 6391 }, 6392 canAccessIFrame: function (iframe) { 6393 var can = false; 6394 try { 6395 var doc = iframe.contentDocument || iframe.contentWindow.document; 6396 can = !!doc.body && !!doc.documentElement; 6397 } catch (err) { 6398 } 6399 return can; 6400 }, 6401 createStyle: function (c, css, ins) { 6402 ins = ins || document.getElementsByTagName('head')[0]; 6403 var style = mw.$(c)[0]; 6404 if (!style) { 6405 style = document.createElement('style'); 6406 ins.appendChild(style); 6407 } 6408 style.innerHTML = css; 6409 return style; 6410 }, 6411 cssNumber: function (val) { 6412 var units = ["px", "%", "in", "cm", "mm", "em", "ex", "pt", "pc"]; 6413 if (typeof val === 'number') { 6414 return val + 'px'; 6415 } 6416 else if (typeof val === 'string' && parseFloat(val).toString() === val) { 6417 return val + 'px'; 6418 } 6419 else { 6420 if (isNaN(parseFloat(val))) { 6421 return '0px'; 6422 } 6423 else { 6424 return val; 6425 } 6426 } 6427 6428 }, 6429 isField: function (target) { 6430 var t = target.nodeName.toLowerCase(); 6431 var fields = /^(input|textarea|select)$/i; 6432 return fields.test(t); 6433 }, 6434 6435 toggleCheckbox: function (node) { 6436 if (node === null || node === undefined) return false; 6437 node.checked = !node.checked; 6438 return node.checked; 6439 }, 6440 jQueryFields: function (root) { 6441 if (typeof root === 'string') { 6442 root = document.querySelector(root); 6443 } 6444 if (typeof root === 'undefined' || root === null) return false; 6445 var allFields = "textarea, select, input[type='checkbox']:checked, input[type='color'], input[type='date'], input[type='datetime'], input[type='datetime-local'], input[type='email'], input[type='file'], input[type='hidden'], input[type='month'], input[type='number'], input[type='password'], input[type='radio']:checked, input[type='range'], input[type='search'], input[type='tel'], input[type='text'], input[type='time'], input[type='url'], input[type='week']"; 6446 return mw.$(allFields, fields).not(':disabled'); 6447 }, 6448 toggle: function (who, toggler, callback) { 6449 who = mw.$(who); 6450 who.toggle(); 6451 who.toggleClass('toggle-active'); 6452 mw.$(toggler).toggleClass('toggler-active'); 6453 mw.is.func(callback) ? callback.call(who) : ''; 6454 }, 6455 _confirm: function (question, callback) { 6456 var conf = confirm(question); 6457 if (conf && typeof callback === 'function') { 6458 callback.call(window); 6459 } 6460 return conf; 6461 }, 6462 el_switch: function (arr, type) { 6463 if (type === 'semi') { 6464 mw.$(arr).each(function () { 6465 var el = mw.$(this); 6466 if (el.hasClass("semi_hidden")) { 6467 el.removeClass("semi_hidden"); 6468 } 6469 else { 6470 el.addClass("semi_hidden"); 6471 } 6472 }); 6473 } 6474 else { 6475 mw.$(arr).each(function () { 6476 var el = mw.$(this); 6477 if (el.css('display') === 'none') { 6478 el.show(); 6479 } 6480 else { 6481 el.hide(); 6482 } 6483 }); 6484 } 6485 }, 6486 focus_on: function (el) { 6487 if (!$(el).hasClass('mw-focus')) { 6488 mw.$(".mw-focus").each(function () { 6489 this !== el ? mw.$(this).removeClass('mw-focus') : ''; 6490 }); 6491 mw.$(el).addClass('mw-focus'); 6492 } 6493 }, 6494 scrollTo: function (el, callback, minus) { 6495 6496 minus = minus || 0; 6497 if ($(el).length === 0) { 6498 return false;
6499 } 6500 if (typeof callback === 'number') { 6501 minus = callback; 6502 } 6503 mw.$('html,body').stop().animate({scrollTop: mw.$(el).offset().top - minus}, function () { 6504 typeof callback === 'function' ? callback.call(el) : ''; 6505 }); 6506 }, 6507 accordion: function (el, callback) { 6508 var speed = 200; 6509 var container = el.querySelector('.mw-accordion-content'); 6510 if (container === null) return false; 6511 var is_hidden = getComputedStyle(container).display === 'none'; 6512 if (!$(container).is(":animated")) { 6513 if (is_hidden) { 6514 mw.$(container).slideDown(speed, function () { 6515 mw.$(el).addClass('active'); 6516 typeof callback === 'function' ? callback.call(el, 'visible') : ''; 6517 }); 6518 } 6519 else { 6520 mw.$(container).slideUp(speed, function () { 6521 mw.$(el).removeClass('active'); 6522 typeof callback === 'function' ? callback.call(el, 'hidden') : ''; 6523 }); 6524 } 6525 } 6526 }, 6527 index: function (el, parent, selector) { 6528 el = mw.$(el)[0]; 6529 selector = selector || el.tagName.toLowerCase(); 6530 parent = parent || el.parentNode; 6531 var all; 6532 if (parent.constructor === [].constructor) { 6533 all = parent; 6534 } 6535 else { 6536 all = mw.$(selector, parent) 6537 } 6538 var i = 0, l = all.length; 6539 for (; i < l; i++) { 6540 if (el === all[i]) return i; 6541 } 6542 }, 6543 6544 highlight: function (el, color, speed1, speed2) { 6545 if (!el) return false; 6546 mw.$(el).stop(); 6547 color = color || '#48AD79'; 6548 speed1 = speed1 || 777; 6549 speed2 = speed2 || 777; 6550 var curr = window.getComputedStyle(el, null).backgroundColor; 6551 if (curr === 'transparent') { 6552 curr = '#ffffff'; 6553 } 6554 mw.$(el).animate({backgroundColor: color}, speed1, function () { 6555 mw.$(el).animate({backgroundColor: curr}, speed2, function () { 6556 mw.$(el).css('backgroundColor', ''); 6557 }); 6558 }); 6559 }, 6560 highlightStop: function (el) { 6561 mw.$(el).stop(); 6562 mw.$(el).css('backgroundColor', ''); 6563 }, 6564 toCamelCase: function (str) { 6565 return str.replace(/(\-[a-z])/g, function (a) { 6566 return a.toUpperCase().replace('-', ''); 6567 }); 6568 }, 6569 multihover: function () { 6570 var l = arguments.length, i = 1; 6571 var type = arguments[0].type; 6572 var check = ( type === 'mouseover' || type === 'mouseenter'); 6573 for ( ; i < l; i++ ) { 6574 check ? mw.$(arguments[i]).addClass('hovered') : mw.$(arguments[i]).removeClass('hovered'); 6575 } 6576 }, 6577 listSearch: function (val, list) { 6578 val = val.trim().toLowerCase(); 6579 if(!val) { 6580 $('li', list).show(); 6581 return; 6582 } 6583 this.search(val, 'li', function (found) { 6584 if(found) { 6585 $(this).show(); 6586 } else { 6587 $(this).hide(); 6588 } 6589 6590 }, list); 6591 }, 6592 search: function (string, selector, callback, root) { 6593 root = !!root ? $(root)[0] : mwd; 6594 if (!root) { 6595 return; 6596 } 6597 string = string.toLowerCase(); 6598 var items; 6599 if (typeof selector === 'object') { 6600 items = selector; 6601 } 6602 else if (typeof selector === 'string') { 6603 items = root.querySelectorAll(selector); 6604 } 6605 else { 6606 return false; 6607 } 6608 var i = 0, l = items.length; 6609 for (; i < l; i++) { 6610 items[i].textContent.toLowerCase().contains(string) ? callback.call(items[i], true) : callback.call(items[i], false); 6611 } 6612 }, 6613 ajaxIsSearching: false, 6614 ajaxSearcSetting: { 6615 limit: 10, 6616 keyword: '', 6617 order_by: 'updated_at desc',
6618 search_in_fields: 'title' 6619 }, 6620 ajaxSearch: function (o, callback) { 6621 if (!mw.tools.ajaxIsSearching) { 6622 var obj = $.extend({}, mw.tools.ajaxSearcSetting, o); 6623 mw.tools.ajaxIsSearching = $.post(mw.settings.site_url + "api/get_content_admin", obj, function (data) { 6624 if (typeof callback === 'function') { 6625 callback.call(data, data); 6626 } 6627 }).always(function () { 6628 mw.tools.ajaxIsSearching = false 6629 }); 6630 } 6631 return mw.tools.ajaxIsSearching; 6632 }, 6633 getPostById: function (id, callback) { 6634 var config = { 6635 limit: 10, 6636 keyword: '', 6637 order_by: 'updated_at desc', 6638 search_in_fields: 'id', 6639 id: id 6640 }; 6641 return this.ajaxSearch(config, callback); 6642 }, 6643 iframeLinksToParent: function (iframe) { 6644 mw.$(iframe).contents().find('a').each(function () { 6645 var href = this.href; 6646 if (href.contains(mw.settings.site_url)) { 6647 this.target = '_parent'; 6648 } 6649 }); 6650 }, 6651 get_filename: function (s) { 6652 if (s.contains('.')) { 6653 var d = s.lastIndexOf('.'); 6654 return s.substring(s.lastIndexOf('/') + 1, d < 0 ? s.length : d); 6655 } 6656 else { 6657 return undefined; 6658 } 6659 }, 6660 is_field: function (obj) { 6661 if (obj === null || typeof obj === 'undefined' || obj.nodeType === 3) { 6662 return false; 6663 } 6664 if (!obj.nodeName) { 6665 return false; 6666 } 6667 var t = obj.nodeName.toLowerCase(); 6668 if (t === 'input' || t === 'textarea' || t === 'select') { 6669 return true 6670 } 6671 return false; 6672 }, 6673 getAttrs: function (el) { 6674 var attrs = el.attributes; 6675 var obj = {}; 6676 for (var x in attrs) { 6677 if (attrs[x].nodeName) { 6678 obj[attrs[x].nodeName] = attrs[x].nodeValue; 6679 } 6680 } 6681 return obj; 6682 }, 6683 copyAttributes: function (from, to, except) { 6684 except = except || []; 6685 var attrs = mw.tools.getAttrs(from); 6686 if (mw.tools.is_field(from) && mw.tools.is_field(to)) to.value = from.value; 6687 for (var x in attrs) { 6688 ( $.inArray(x, except) == -1 && x != 'undefined') ? to.setAttribute(x, attrs[x]) : ''; 6689 } 6690 }, 6691 isEmptyObject: function (obj) { 6692 for (var a in obj) { 6693 if (obj.hasOwnProperty(a)) return false; 6694 } 6695 return true; 6696 }, 6697 objLenght: function (obj) { 6698 var len = 0, x; 6699 if (obj.constructor === {}.constructor) { 6700 for ( x in obj ) { 6701 len++; 6702 } 6703 } 6704 return len; 6705 }, 6706 scaleTo: function (selector, w, h) { 6707 w = w || 800; 6708 h = h || 600; 6709 var is_percent = w.toString().contains("%") ? true : false; 6710 var item = mw.$(selector); 6711 if (item.hasClass('mw-scaleto') || w == 'close') { 6712 item.removeClass('mw-scaleto'); 6713 item.removeAttr('style'); 6714 } 6715 else { 6716 item.parent().height(item.height()); 6717 item.addClass('mw-scaleto'); 6718 if (is_percent) { 6719 item.css({ 6720 width: w, 6721 height: h, 6722 left: ((100 - parseFloat(w)) / 2) + "%", 6723 top: ((100 - parseFloat(h)) / 2) + "%" 6724 }); 6725 } 6726 else { 6727 item.css({ 6728 width: w, 6729 height: h, 6730 marginLeft: -w / 2, 6731 marginTop: -h / 2 6732 }); 6733 } 6734 } 6735 }, 6736 getFirstEqualFromTwoArrays: function (a, b) { 6737 var ia = 0, ib = 0, la = a.length, lb = b.length; 6738 loop: 6739 for (; ia < la; ia++) { 6740 var curr = a[ia]; 6741 for (; ib < lb; ib++) { 6742 if (b[ib] == curr) { 6743 return curr; 6744 } 6745 } 6746 } 6747 }, 6748 has: function (el, what) { 6749 return el.querySelector(what) !== null; 6750 }, 6751 html_info: function (html) { 6752 if (typeof mw._html_info === 'undefined') { 6753 mw._html_info = document.createElement('div'); 6754 mw._html_info.id = 'mw-html-info'; 6755 document.body.appendChild(mw._html_info); 6756 } 6757 mw.$(mw._html_info).html(html); 6758 return mw._html_info; 6759 }, 6760 image_info: function (a, callback) { 6761 var img = document.createElement('img'); 6762 img.className = 'semi_hidden'; 6763 img.src = a.src; 6764 document.body.appendChild(img); 6765 img.onload = function () { 6766 callback.call({width: mw.$(img).width(), height: mw.$(img).height()}); 6767 mw.$(img).remove(); 6768 }; 6769 }, 6770 refresh_image: function (node) { 6771 node.src = mw.url.set_param('refresh_image', mw.random(), node.src); 6772 return node; 6773 }, 6774 refresh: function (a, onSuccess) { 6775 if (a === null || typeof a === 'undefined') { 6776 return false;
6777 } 6778 if (a.src) { 6779 a.src = mw.url.set_param('mwrefresh', mw.random(), a.src); 6780 if(onSuccess) { 6781 jQuery.get(a.getAttribute('src'), function(e){ 6782 onSuccess.call(a, e) 6783 }) 6784 } 6785 6786 } 6787 else if (a.href) { 6788 a.href = mw.url.set_param('mwrefresh', mw.random(), a.href); 6789 if(onSuccess) { 6790 jQuery.get(a.getAttribute('href'), function(e){ 6791 onSuccess.call(a, e) 6792 }) 6793 } 6794 } 6795 }, 6796 getDiff: function (_new, _old) { 6797 var diff = {}, x, y; 6798 for (x in _new) { 6799 if (!x in _old || _old[x] != _new[x]) { 6800 diff[x] = _new[x]; 6801 } 6802 } 6803 for (y in _old) { 6804 if (typeof _new[y] === 'undefined') { 6805 diff[y] = ""; 6806 } 6807 } 6808 return diff; 6809 }, 6810 parseHtml: function (html) { 6811 var doc = document.implementation.createHTMLDocument(""); 6812 doc.body.innerHTML = html; 6813 return doc; 6814 }, 6815 isEmpty: function (node) { 6816 return ( node.innerHTML.trim() ).length === 0; 6817 }, 6818 isJSON: function (a) { 6819 if (typeof a === 'object') { 6820 if (a.constructor === {}.constructor) { 6821 return true; 6822 } 6823 else { 6824 return false; 6825 } 6826 } 6827 else if (typeof a === 'string') { 6828 try { 6829 JSON.parse(a); 6830 } 6831 catch (e) { 6832 return false; 6833 } 6834 return true; 6835 } 6836 else { 6837 return false; 6838 } 6839 }, 6840 toJSON: function (w) { 6841 if (typeof w === 'object' && mw.tools.isJSON(w)) { 6842 return w; 6843 } 6844 if (typeof w === 'string') { 6845 try { 6846 var r = JSON.parse(w); 6847 } 6848 catch (e) { 6849 var r = {"0": w}; 6850 } 6851 return r; 6852 } 6853 if (typeof w === 'object' && w.constructor === [].constructor) { 6854 var obj = {}, i = 0, l = w.length; 6855 for (; i < l; i++) { 6856 obj[i] = w[i]; 6857 } 6858 return obj; 6859 } 6860 }, 6861 mwattr: function (el, a, b) { 6862 if (!b && !!el) { 6863 var data = mw.$(el).dataset(a); 6864 if (!!$(el)[0].attributes) { 6865 var attr = mw.$(el)[0].attributes[a]; 6866 } 6867 6868 if (data !== '') { 6869 return data; 6870 } 6871 if (!!attr) { 6872 return attr.value; 6873 } 6874 return false; 6875 } 6876 else { 6877 mw.$(el).dataset(a, b); 6878 } 6879 }, 6880 disable: function (el, text, global) { 6881 text = text || mw.msg.loading + '...'; 6882 global = global || false; 6883 var _el = mw.$(el); 6884 if (!_el.length) { 6885 return false; 6886 } 6887 if (!_el.hasClass("disabled")) { 6888 _el.addClass('disabled'); 6889 if (_el[0].tagName !== 'INPUT') { 6890 _el.dataset("text", _el.html()); 6891 _el.html(text); 6892 } 6893 else { 6894 _el.dataset("text", _el.val()); 6895 _el.val(text); 6896 } 6897 if (global) mw.$(document.body).addClass("loading"); 6898 } 6899 return el; 6900 }, 6901 enable: function (el) { 6902 var _el = mw.$(el); 6903 if (!_el.length) { 6904 return false; 6905 } 6906 var text = _el.dataset("text"); 6907 _el.removeClass("disabled"); 6908 if (_el[0].tagName !== 'INPUT') { 6909 _el.html(text); 6910 } 6911 else { 6912 _el.val(text); 6913 } 6914 mw.$(document.body).removeClass("loading"); 6915 return el; 6916 }, 6917 prependClass: function (el, cls) { 6918 el.className = (cls + ' ' + el.className).trim() 6919 }, 6920 inview: function (el) { 6921 var $el = mw.$(el); 6922 if ($el.length === 0) { 6923 return false;
6924 } 6925 var dt = mw.$(window).scrollTop(), 6926 db = dt + mw.$(window).height(), 6927 et = $el.offset().top; 6928 return (et <= db) && !(dt > ($el.height() + et)); 6929 }, 6930 wholeinview: function (el) { 6931 var $el = mw.$(el), 6932 dt = mw.$(window).scrollTop(), 6933 db = dt + mw.$(window).height(), 6934 et = $el.offset().top, 6935 eb = et + mw.$(el).height(); 6936 return ((eb <= db) && (et >= dt)); 6937 }, 6938 preload: function (u, c) { 6939 var im = new Image(); 6940 if (typeof c === 'function') { 6941 im.onload = function () { 6942 c.call(u, im); 6943 } 6944 } 6945 im.src = u; 6946 }, 6947 mapNodeValues: function (n1, n2) { 6948 if (!n1 || !n2) return false; 6949 var setValue1 = ((!!n1.type && n1.nodeName !== 'BUTTON') || n1.nodeName === 'TEXTAREA') ? 'value' : 'textContent'; 6950 var setValue2 = ((!!n2.type && n2.nodeName !== 'BUTTON') || n2.nodeName === 'TEXTAREA') ? 'value' : 'textContent'; 6951 var events = 'keyup paste'; 6952 mw.$(n1).bind(events, function () { 6953 n2[setValue2] = n1[setValue1]; 6954 mw.$(n2).trigger('change'); 6955 }); 6956 mw.$(n2).bind(events, function () { 6957 n1[setValue1] = n2[setValue2]; 6958 mw.$(n1).trigger('change'); 6959 }); 6960 }, 6961 copyEvents: function (from, to) { 6962 if (typeof $._data(from, 'events') === 'undefined') { 6963 return false; 6964 } 6965 $.each($._data(from, 'events'), function () { 6966 $.each(this, function () { 6967 mw.$(to).bind(this.type, this.handler); 6968 }); 6969 }); 6970 }, 6971 setTag: function (node, tag) { 6972 var el = document.createElement(tag); 6973 mw.tools.copyAttributes(node, el); 6974 while (node.firstChild) { 6975 el.appendChild(node.firstChild); 6976 } 6977 mw.tools.copyEvents(node, el); 6978 mw.$(node).replaceWith(el); 6979 return el; 6980 }, 6981 6982 module_settings: function (a, view, liveedit) { 6983 var opts = {}; 6984 if (typeof liveedit === 'undefined') { 6985 opts.liveedit = true; 6986 } 6987 if (!!view) { 6988 opts.view = view; 6989 } 6990 else { 6991 opts.view = 'admin'; 6992 } 6993 return mw.live_edit.showSettings(a, opts); 6994 }, 6995 fav: function (a) { 6996 var canvas = document.createElement("canvas"); 6997 canvas.width = 16; 6998 canvas.height = 16; 6999 var context = canvas.getContext("2d"); 7000 context.fillStyle = "#EF3D25"; 7001 context.fillRect(0, 0, 16, 16); 7002 context.font = "normal 10px Arial"; 7003 context.textAlign = 'center'; 7004 context.textBaseline = 'middle'; 7005 context.fillStyle = "white"; 7006 context.fillText(a, 8, 8); 7007 var im = canvas.toDataURL(); 7008 var l = document.createElement('link'); 7009 l.className = 'mwfav'; 7010 l.setAttribute('rel', 'icon'); 7011 l.setAttribute('type', 'image/png'); 7012 l.href = im; 7013 mw.$(".mwfav").remove(); 7014 document.getElementsByTagName('head')[0].appendChild(l); 7015 }, 7016 px2pt: function (px) { 7017 var n = parseInt(px, 10); 7018 if (isNaN(n)) { 7019 return false; 7020 } 7021 return Math.round(((3 / 4) * n)); 7022 }, 7023 matches: function (node, what) { 7024 if (node === 'init') { 7025 if (!!document.documentElement.matches) mw.tools.matchesMethod = 'matches'; 7026 else if (!!document.documentElement.matchesSelector) mw.tools.matchesMethod = 'matchesSelector'; 7027 else if (!!document.documentElement.mozMatchesSelector) mw.tools.matchesMethod = 'mozMatchesSelector'; 7028 else if (!!document.documentElement.webkitMatchesSelector) mw.tools.matchesMethod = 'webkitMatchesSelector';
7029 else if (!!document.documentElement.msMatchesSelector) mw.tools.matchesMethod = 'msMatchesSelector'; 7030 else if (!!document.documentElement.oMatchesSelector) mw.tools.matchesMethod = 'oMatchesSelector'; 7031 else mw.tools.matchesMethod = undefined; 7032 } 7033 else { 7034 if (node === null) { 7035 return false; 7036 } 7037 if (typeof node === 'undefined') { 7038 return false; 7039 } 7040 if (node.nodeType !== 1) { 7041 return false; 7042 } 7043 if (!!mw.tools.matchesMethod) { 7044 return node[mw.tools.matchesMethod](what) 7045 } 7046 else { 7047 var doc = document.implementation.createHTMLDocument(""); 7048 node = node.cloneNode(true); 7049 doc.body.appendChild(node); 7050 var all = doc.body.querySelectorAll(what), 7051 l = all.length, 7052 i = 0; 7053 for (; i < l; i++) { 7054 if (all[i] === node) { 7055 return true; 7056 } 7057 } 7058 return false; 7059 } 7060 } 7061 } 7062 } 7063 7064 Object.assign(expose, helpers); 7065 expose.matches('init'); 7066 7067})(mw.tools); 7068 7069 7070mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/iframe-tools.js'); 7071 7072mw.tools.createAutoHeight = function() { 7073 if(window.thismodal && thismodal.iframe) { 7074 mw.tools.iframeAutoHeight(thismodal.iframe); 7075 } 7076 else if(mw.top().win.frameElement && mw.top().win.frameElement.contentWindow === window) { 7077 mw.tools.iframeAutoHeight(mw.top().win.frameElement); 7078 } else if(window.top !== window) { 7079 mw.top().$('iframe').each(function(){ 7080 try{ 7081 if(this.contentWindow === window) { 7082 mw.tools.iframeAutoHeight(this); 7083 } 7084 } catch(e){} 7085 }) 7086 } 7087}; 7088 7089mw.tools.moduleFrame = function(type, template, options){ 7090 var defaults = { 7091 url: route('live_edit.module_settings') + '?type=' + type + (template ? ('&template=' + template) : ''), 7092 width: 532, 7093 height: 'auto', 7094 autoHeight:true, 7095 title: type, 7096 className: 'mw-dialog-module-settings', 7097 closeButtonAction: 'remove' 7098 }; 7099 options = options || {}; 7100 var settings = Object.assign({}, defaults, options) 7101 return mw.dialogIframe(); 7102}; 7103 7104 7105mw.tools.iframeAutoHeight = function(frame, opt){ 7106 7107 opt = opt || {}; 7108 opt.maxHeightWindowScroll = opt.maxHeightWindowScroll || null; 7109 7110 frame = mw.$(frame)[0]; 7111 if(!frame) return; 7112 7113 7114 if(frame.dataset.autoHeight === 'false') return; 7115 7116 var _detector = document.createElement('div'); 7117 _detector.className = 'mw-iframe-auto-height-detector'; 7118 _detector.id = mw.id(); 7119 7120 var insertDetector = function() { 7121 if(frame.contentWindow && frame.contentWindow.document && frame.contentWindow.document.body){ 7122 var det = frame.contentWindow.document.querySelector('.mw-iframe-auto-height-detector'); 7123 if(!det){ 7124 frame.contentWindow.document.body.appendChild(_detector); 7125 } else if(det !== frame.contentWindow.document.body.lastChild){ 7126 frame.contentWindow.document.body.appendChild(det); 7127 } 7128 if(frame.contentWindow.mw) { 7129 frame.contentWindow.mw._iframeDetector = _detector; 7130 } 7131 7132 } 7133 }; 7134 7135 7136 7137 setTimeout(function(){ 7138 insertDetector(); 7139 }, 100); 7140 frame.style.minHeight = 0 + 'px'; 7141 if (opt.maxHeightWindowScroll) { 7142 frame.style.maxHeight = opt.maxHeightWindowScroll; 7143 frame.style.overflow = 'auto'; 7144 frame.scrolling="auto" 7145 } else { 7146 frame.scrolling="auto"; 7147 frame.style.overflow = 'hidden'; 7148 } 7149 mw.$(frame).on('load resize', function(){ 7150 7151 if(!mw.tools.canAccessIFrame(frame)) { 7152 console.log('Iframe can not be accessed.', frame); 7153 return; 7154 } 7155 if(!frame.contentWindow.document.body){ 7156 return; 7157 } 7158 if(!!frame.contentWindow.document.querySelector('.mw-iframe-auto-height-detector')){ 7159 return; 7160 } 7161 insertDetector(); 7162 if (opt.maxHeightWindowScroll) { 7163 frame.style.maxHeight = opt.maxHeightWindowScroll; 7164 frame.style.overflow = 'auto'; 7165 frame.scrolling="auto"; 7166 } else { 7167 frame.scrolling="auto"; 7168 frame.style.overflow = 'hidden'; 7169 } 7170 }); 7171 var offset = function () { 7172 return _detector.getBoundingClientRect().top; 7173 }; 7174 frame._intPause = false;
7175 frame._int = setInterval(function(){ 7176 if(!frame._intPause && frame.parentNode && frame.contentWindow && frame.contentWindow.document.body){ 7177 var calc = offset() + _detector.offsetHeight; 7178 frame._currHeight = frame._currHeight || 0; 7179 if(calc && calc !== frame._currHeight ){ 7180 frame._currHeight = calc; 7181 frame.style.height = Math.max(calc) + 'px'; 7182 var scroll = Math.max(frame.contentWindow.document.documentElement.scrollHeight, frame.contentWindow.document.body.scrollHeight); 7183 if(scroll > frame._currHeight) { 7184 frame._currHeight = scroll; 7185 frame.style.height = scroll + 'px'; 7186 } 7187 mw.$(frame).trigger('bodyResize'); 7188 } 7189 } else if(!frame.parentElement){ 7190 clearInterval(frame._int); 7191 } 7192 else { 7193 //clearInterval(frame._int); 7194 } 7195 }, 77); 7196 7197}; 7198 7199 7200mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/images.js'); 7201 7202mw.image = { 7203 isResizing: false, 7204 currentResizing: null, 7205 resize: { 7206 create_resizer: function () { 7207 if (!mw.image_resizer) { 7208 var resizer = document.createElement('div'); 7209 resizer.className = 'mw-defaults mw_image_resizer'; 7210 resizer.innerHTML = '<div id="image-edit-nav"><span onclick="mw.wysiwyg.media(\'#editimage\');" class="btn btn-link mw-ui-btn-invert mw-ui-btn-icon image_change tip" data-tip="' + mw.msg.change + '"><span class="mdi mdi-image mdi-18px"></span></span><span class="btn btn-link mw-ui-btn-invert mw-ui-btn-icon tip image_change" id="image-settings-button" data-tip="' + mw.msg.edit + '" onclick="mw.image.settings();"><span class="mdi mdi-pencil mdi-18px"></span></span></div>'; 7211 document.body.appendChild(resizer); 7212 mw.image_resizer = resizer; 7213 mw.image_resizer_time = null; 7214 mw.image_resizer._show = function () { 7215 clearTimeout(mw.image_resizer_time) 7216 mw.$(mw.image_resizer).addClass('active') 7217 }; 7218 mw.image_resizer._hide = function () { 7219 clearTimeout(mw.image_resizer_time) 7220 mw.image_resizer_time = setTimeout(function () { 7221 mw.$(mw.image_resizer).removeClass('active') 7222 }, 3000) 7223 }; 7224 7225 mw.$(resizer).on("click", function (e) { 7226 if (mw.image.currentResizing[0].nodeName === 'IMG') { 7227 mw.wysiwyg.select_element(mw.image.currentResizing[0]) 7228 } 7229 }); 7230 mw.$(resizer).on("dblclick", function (e) { 7231 mw.wysiwyg.media('#editimage'); 7232 }); 7233 } 7234 }, 7235 prepare: function () { 7236 mw.image.resize.create_resizer(); 7237 mw.$(mw.image_resizer).resizable({ 7238 handles: "all", 7239 minWidth: 60, 7240 minHeight: 60, 7241 start: function () { 7242 mw.image.isResizing = true; 7243 mw.$(mw.image_resizer) 7244 .resizable("option", "maxWidth", mw.image.currentResizing.parent().width()) 7245 .height('auto'); 7246 mw.$(mw.tools.firstParentWithClass(mw.image.currentResizing[0], 'edit')).addClass("changed"); 7247 }, 7248 stop: function () { 7249 mw.image.isResizing = false; 7250 mw.drag.fix_placeholders(); 7251 mw.image.currentResizing[0].style.height = 'auto'; 7252 mw.wysiwyg.change(mw.image.currentResizing[0]); 7253 7254 7255 }, 7256 resize: function () { 7257 var offset = mw.image.currentResizing.offset(); 7258 mw.$(this).css(offset); 7259 mw.image.currentResizing[0].style.height = 'auto'; 7260 }, 7261 aspectRatio: 16 / 9 7262 }); 7263 mw.image_resizer.mwImageResizerComponent = true; 7264 var all = mw.image_resizer.querySelectorAll('*'), l = all.length, i = 0; 7265 for (; i < l; i++) all[i].mwImageResizerComponent = true 7266 }, 7267 resizerSet: function (el, selectImage) { 7268 selectImage = typeof selectImage === 'undefined' ? true : selectImage; 7269 /* var order = mw.tools.parentsOrder(el, ['edit', 'module']); 7270 if(!(order.module > -1 && order.edit > order.module) && order.edit>-1){ */ 7271 7272 7273 mw.$('.ui-resizable-handle', mw.image_resizer)[el.nodeName == 'IMG' ? 'show' : 'hide']() 7274 7275 el = mw.$(el); 7276 var offset = el.offset(); 7277 var parent = el.parent(); 7278 var parentOffset = parent.offset(); 7279 if(parent[0].nodeName !== 'A'){ 7280 offset.top = offset.top < parentOffset.top ? parentOffset.top : offset.top; 7281 offset.left = offset.left < parentOffset.left ? parentOffset.left : offset.left; 7282 } 7283 var r = mw.$(mw.image_resizer); 7284 var width = el.outerWidth(); 7285 var height = el.outerHeight(); 7286 r.css({ 7287 left: offset.left, 7288 top: offset.top, 7289 width: width, 7290 height: mw.tools.hasParentsWithClass(el[0], 'mw-image-holder') ? 1 : height 7291 }); 7292 r.addClass("active"); 7293 mw.$(mw.image_resizer).resizable("option", "alsoResize", el); 7294 mw.$(mw.image_resizer).resizable("option", "aspectRatio", width / height); 7295 mw.image.currentResizing = el; 7296 if (!el[0].contentEditable) { 7297 mw.wysiwyg.contentEditable(el[0], true); 7298 } 7299 7300 if (selectImage) { 7301 if (el[0].parentNode.tagName !== 'A') {
7302 mw.wysiwyg.select_element(el[0]); 7303 } 7304 else { 7305 mw.wysiwyg.select_element(el[0].parentNode); 7306 } 7307 } 7308 if (document.getElementById('image-settings-button') !== null) { 7309 if (!!el[0].src && el[0].src.contains('userfiles/media/pixum/')) { 7310 document.getElementById('image-settings-button').style.display = 'none'; 7311 } 7312 else { 7313 document.getElementById('image-settings-button').style.display = ''; 7314 } 7315 } 7316 /* } */ 7317 }, 7318 init: function (selector) { 7319 mw.image_resizer == undefined ? mw.image.resize.prepare() : ''; 7320 7321 mw.on("ImageClick", function (e, el) { 7322 if (!mw.image.isResizing && !mw.isDrag && !mw.settings.resize_started && el.tagName === 'IMG') { 7323 mw.image.resize.resizerSet(el); 7324 } 7325 }) 7326 } 7327 }, 7328 7329 _isrotating: false, 7330 rotate: function (img_object, angle) { 7331 if (!mw.image.Rotator) { 7332 mw.image.Rotator = document.createElement('canvas'); 7333 mw.image.Rotator.style.top = '-9999px'; 7334 mw.image.Rotator.style.left = '-9999px'; 7335 mw.image.Rotator.style.position = 'absolute'; 7336 mw.image.RotatorContext = mw.image.Rotator.getContext('2d'); 7337 document.body.appendChild(mw.image.Rotator); 7338 } 7339 if (!mw.image._isrotating) { 7340 mw.image._isrotating = true; 7341 img_object = img_object || document.querySelector("img.element-current"); 7342 if (img_object === null) { 7343 return false; 7344 } 7345 mw.image.preload(img_object.src, function () { 7346 if (!img_object.src.contains("base64")) { 7347 var currDomain = mw.url.getDomain(window.location.href); 7348 var srcDomain = mw.url.getDomain(img_object.src); 7349 if (currDomain !== srcDomain) { 7350 mw.tools.alert("This action is allowed for images on the same domain."); 7351 return false; 7352 } 7353 } 7354 var angle = angle || 90; 7355 var image = mw.$(this); 7356 var w = this.naturalWidth; 7357 var h = this.naturalHeight; 7358 var contextWidth = w; 7359 var contextHeight = h; 7360 var x = 0; 7361 var y = 0; 7362 switch (angle) { 7363 case 90: 7364 contextWidth = h; 7365 contextHeight = w; 7366 y = -h; 7367 break; 7368 case 180: 7369 x = -w; 7370 y = -h; 7371 break; 7372 case 270: 7373 contextWidth = h; 7374 contextHeight = w; 7375 x = -w; 7376 break; 7377 default: 7378 contextWidth = h; 7379 contextHeight = w; 7380 y = -h; 7381 } 7382 mw.image.Rotator.setAttribute('width', contextWidth); 7383 mw.image.Rotator.setAttribute('height', contextHeight); 7384 mw.image.RotatorContext.rotate(angle * Math.PI / 180); 7385 mw.image.RotatorContext.drawImage(img_object, x, y); 7386 var data = mw.image.Rotator.toDataURL("image/png"); 7387 img_object.src = data; 7388 mw.image._isrotating = false; 7389 }); 7390 } 7391 }, 7392 grayscale: function (node) { 7393 var node = node || document.querySelector("img.element-current"); 7394 if (node === null) { 7395 return false; 7396 } 7397 mw.image.preload(node.src, function () { 7398 var canvas = document.createElement('canvas'); 7399 var ctx = canvas.getContext('2d'); 7400 canvas.width = this.naturalWidth; 7401 canvas.height = this.naturalHeight; 7402 ctx.drawImage(node, 0, 0); 7403 var imgPixels = ctx.getImageData(0, 0, canvas.width, canvas.height); 7404 for (var y = 0; y < imgPixels.height; y++) { 7405 for (var x = 0; x < imgPixels.width; x++) { 7406 var i = (y * 4) * imgPixels.width + x * 4; //Why is this multiplied by 4? 7407 var avg = (imgPixels.data[i] + imgPixels.data[i + 1] + imgPixels.data[i + 2]) / 3; 7408 imgPixels.data[i] = avg; 7409 imgPixels.data[i + 1] = avg; 7410 imgPixels.data[i + 2] = avg; 7411 } 7412 } 7413 ctx.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height); 7414 node.src = canvas.toDataURL(); 7415 }) 7416 }, 7417 vr: [0, 0, 0, 1, 1, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 47, 48, 49, 52, 54, 55, 57, 59, 60, 62, 65, 67, 69, 70, 72, 74, 77, 79, 81, 83, 86, 88, 90, 92, 94, 97, 99, 101, 103,
7417107, 109, 111, 112, 116, 118, 120, 124, 126, 127, 129, 133, 135, 136, 140, 142, 143, 145, 149, 150, 152, 155, 157, 159, 162, 163, 165, 167, 170, 171, 173, 176, 177, 178, 180, 183, 184, 185, 188, 189, 190, 192, 194, 195, 196, 198, 200, 201, 202, 203, 204, 206, 207, 208, 209, 211, 212, 213, 214, 215, 216, 218, 219, 219, 220, 221, 222, 223, 224, 225, 226, 227, 227, 228, 229, 229, 230, 231, 232, 232, 233, 234, 234, 235, 236, 236, 237, 238, 238, 239, 239, 240, 241, 241, 242, 242, 243, 244, 244, 245, 245, 245, 246, 247, 247, 248, 248, 249, 249, 249, 250, 251, 251, 252, 252, 252, 253, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], 7418 vg: [0, 0, 1, 2, 2, 3, 5, 5, 6, 7, 8, 8, 10, 11, 11, 12, 13, 15, 15, 16, 17, 18, 18, 19, 21, 22, 22, 23, 24, 26, 26, 27, 28, 29, 31, 31, 32, 33, 34, 35, 35, 37, 38, 39, 40, 41, 43, 44, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 83, 84, 85, 86, 88, 89, 90, 92, 93, 94, 95, 96, 97, 100, 101, 102, 103, 105, 106, 107, 108, 109, 111, 113, 114, 115, 117, 118, 119, 120, 122, 123, 124, 126, 127, 128, 129, 131, 132, 133, 135, 136, 137, 138, 140, 141, 142, 144, 145, 146, 148, 149, 150, 151, 153, 154, 155, 157, 158, 159, 160, 162, 163, 164, 166, 167, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 186, 186, 187, 188, 189, 190, 192, 193, 194, 195, 195, 196, 197, 199, 200, 201, 202, 202, 203, 204, 205, 206, 207, 208, 208, 209, 210, 211, 212, 213, 214, 214, 215, 216, 217, 218, 219, 219, 220, 221, 222, 223, 223, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 232, 232, 232, 233, 234, 235, 235, 236, 236, 237, 238, 238, 239, 239, 240, 240, 241, 242, 242, 242, 243, 244, 245, 245, 246, 246, 247, 247, 248, 249, 249, 249, 250, 251, 251, 252, 252, 252, 253, 254, 255], 7419 vb: [53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 65, 65, 65, 66, 66, 67, 67, 67, 68, 69, 69, 69, 70, 70, 71, 71, 72, 73, 73, 73, 74, 74, 75, 75, 76, 77, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 87, 87, 88, 89, 89, 90, 90, 91, 91, 93, 93, 94, 94, 95, 95, 96, 97, 98, 98, 99, 99, 100, 101, 102, 102, 103, 104, 105, 105, 106, 106, 107, 108, 109, 109, 110, 111, 111, 112, 113, 114, 114, 115, 116, 117, 117, 118, 119, 119, 121, 121, 122, 122, 123, 124, 125, 126, 126, 127, 128, 129, 129, 130, 131, 132, 132, 133, 134, 134, 135, 136, 137, 137, 138, 139, 140, 140, 141, 142, 142, 143, 144, 145, 145, 146, 146, 148, 148, 149, 149, 150, 151, 152, 152, 153, 153, 154, 155, 156, 156, 157, 157, 158, 159, 160, 160, 161, 161, 162, 162, 163, 164, 164, 165, 165, 166, 166, 167, 168, 168, 169, 169, 170, 170, 171, 172, 172, 173, 173, 174, 174, 175, 176, 176, 177, 177, 177, 178, 178, 179, 180, 180, 181, 181, 181, 182, 182, 183, 184, 184, 184, 185, 185, 186, 186, 186, 187, 188, 188, 188, 189, 189, 189, 190, 190, 191, 191, 192, 192, 193, 193, 193, 194, 194, 194, 195, 196, 196, 196, 197, 197, 197, 198, 199], 7420 vintage: function (node) { 7421 var node = node || document.querySelector("img.element-current"); 7422 if (node === null) { 7423 return false; 7424 } 7425 var canvas = document.createElement('canvas'); 7426 var ctx = canvas.getContext('2d'); 7427 mw.image.preload(node.src, function (w, h) { 7428 canvas.width = w; 7429 canvas.height = h; 7430 ctx.drawImage(node, 0, 0); 7431 var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height), l = imageData.data.length, i = 0; 7432 for (; i < l; i += 4) { 7433 imageData.data[i] = mw.image.vr[imageData.data[i]]; 7434 imageData.data[i + 1] = mw.image.vg[imageData.data[i + 1]]; 7435 imageData.data[i + 2] = mw.image.vb[imageData.data[i + 2]]; 7436 if (noise > 0) { 7437 var noise = Math.round(noise - Math.random() * noise), j = 0; 7438 for (; j < 3; j++) { 7439 var iPN = noise + imageData.data[i + j]; 7440 imageData.data[i + j] = (iPN > 255) ? 255 : iPN; 7441 } 7442 } 7443 } 7444 ctx.putImageData(imageData, 0, 0); 7445 node.src = canvas.toDataURL(); 7446 mw.$(canvas).remove() 7447 }); 7448 }, 7449 _dragActivated: false, 7450 _dragcurrent: null, 7451 _dragparent: null, 7452 _dragcursorAt: {x: 0, y: 0}, 7453 _dragTxt: function (e) { 7454 if (mw.image._dragcurrent !== null) { 7455 mw.image._dragcursorAt.x = e.pageX - mw.image._dragcurrent.offsetLeft; 7456 mw.image._dragcursorAt.y = e.pageY - mw.image._dragcurrent.offsetTop; 7457 var x = e.pageX - mw.image._dragparent.offsetLeft - mw.image._dragcurrent.startedX - mw.image._dragcursorAt.x; 7458 var y = e.pageY - mw.image._dragparent.offsetTop - mw.image._dragcurrent.startedY - mw.image._dragcursorAt.y; 7459 mw.image._dragcurrent.style.top = y + 'px'; 7460 mw.image._dragcurrent.style.left = x + 'px'; 7461 } 7462 }, 7463 preloadForAll: function (array, eachCall, callback) { 7464 var size = array.length, i = 0, count = 0; 7465 for (; i < size; i++) { 7466 mw.image.preload(array[i], function (imgWidth, imgHeight) { 7467 count++; 7468 if(eachCall) { 7469 eachCall.call(this, imgWidth, imgHeight) 7470 } 7471 if (count === size) { 7472 if (!!callback) callback.call() 7473 } 7474 }) 7475 } 7476 }, 7477 preloadAll: function (array, callback) { 7478 var size = array.length, i = 0, count = 0; 7479 for (; i < size; i++) { 7480 mw.image.preload(array[i], function () { 7481 count++; 7482 if (count === size) { 7483 callback.call() 7484 } 7485 }) 7486 } 7487 }, 7488 preload: function (url, callback) { 7489 var img; 7490 if (typeof window.chrome === 'object') { 7491 var img = new Image(); 7492 } 7493 else { 7494 img = document.createElement('img') 7495 } 7496 img.className = 'semi_hidden'; 7497 img.src = url; 7498 img.onload = function () { 7499 setTimeout(function () { 7500 if (typeof callback === 'function') {
7501 callback.call(img, img.naturalWidth, img.naturalHeight); 7502 } 7503 mw.$(img).remove(); 7504 }, 33); 7505 } 7506 img.onerror = function () { 7507 setTimeout(function () { 7508 if (typeof callback === 'function') { 7509 callback.call(img, 0, 0, 'error'); 7510 } 7511 }, 33); 7512 } 7513 document.body.appendChild(img); 7514 }, 7515 preloadAsLink: function (url, callback) { 7516 7517 var link = document.createElement("link"); 7518 link.href = url; 7519 link.rel = "preload"; 7520 link.as = "image"; 7521 link.onload = function () { 7522 setTimeout(function () { 7523 if (typeof callback === 'function') { 7524 callback.call(img); 7525 } 7526 }, 33); 7527 }; 7528 link.onerror = function () { 7529 setTimeout(function () { 7530 if (typeof callback === 'function') { 7531 callback.call(img); 7532 } 7533 }, 33); 7534 }; 7535 document.head.appendChild(link); 7536 }, 7537 7538 description: { 7539 add: function (text) { 7540 var img = document.querySelector("img.element-current"); 7541 img.title = text; 7542 }, 7543 get: function () { 7544 return document.querySelector("img.element-current").title; 7545 }, 7546 init: function (id) { 7547 var area = mw.$(id); 7548 area.hover(function () { 7549 area.addClass("desc_area_hover"); 7550 }, function () { 7551 area.removeClass("desc_area_hover"); 7552 }); 7553 var curr = mw.image.description.get(); 7554 if (!area.hasClass("inited")) { 7555 area.addClass("inited"); 7556 area.bind("keyup change paste", function () { 7557 var val = mw.$(this).val(); 7558 mw.image.description.add(val); 7559 }); 7560 } 7561 area.val(curr); 7562 area.show(); 7563 } 7564 }, 7565 settings: function () { 7566 return mw.dialogIframe({ 7567 url: 'imageeditor', 7568 template: "mw_modal_basic", 7569 overlay: true, 7570 width: '600', 7571 height: "auto", 7572 autoHeight: true, 7573 name: 'mw-image-settings-modal' 7574 }); 7575 } 7576}; 7577 7578 7579mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/jquery.tools.js'); 7580 7581$.fn.dataset = function (dataset, val) { 7582 var el = this[0]; 7583 if (el === undefined) return false; 7584 var _dataset = !dataset.contains('-') ? dataset : mw.tools.toCamelCase(dataset); 7585 if (!val) { 7586 var dataset = !!el.dataset ? el.dataset[_dataset] : mw.$(el).attr("data-" + dataset); 7587 return dataset !== undefined ? dataset : ""; 7588 } 7589 else { 7590 !!el.dataset ? el.dataset[_dataset] = val : mw.$(el).attr("data-" + dataset, val); 7591 return mw.$(el); 7592 } 7593}; 7594 7595$.fn.reload_module = function (c) { 7596 return this.each(function () { 7597 // if($(this).hasClass("module")){ 7598 (function (el) { 7599 mw.reload_module(el, function () { 7600 if (typeof(c) != 'undefined') { 7601 c.call(el, el) 7602 } 7603 }) 7604 })(this) 7605 // } 7606 }) 7607}; 7608 7609 7610 $.fn.getDropdownValue = function () { 7611 return this.dataset("value") || mw.$('.active', this).attr('value'); 7612 }; 7613 $.fn.setDropdownValue = function (val, triggerChange, isCustom, customValueToDisplay) { 7614 7615 var isCustom = isCustom || false; 7616 var triggerChange = triggerChange || false; 7617 var isValidOption = false; 7618 var customValueToDisplay = customValueToDisplay || false; 7619 var el = this; 7620 if (isCustom) { 7621 var isValidOption = true; 7622 el.dataset("value", val); 7623 triggerChange ? el.trigger("change") : ''; 7624 var valel = mw.$(".mw-dropdown-val", el); 7625 var method = valel[0].type ? 'val' : 'html'; 7626 if (!!customValueToDisplay) { 7627 valel[method](customValueToDisplay); 7628 } 7629 else { 7630 valel[method](val); 7631 } 7632 } 7633 else { 7634 mw.$("[value]", el).each(function () { 7635 if (this.getAttribute('value') == val) { 7636 el.dataset("value", val); 7637 var isValidOption = true; 7638 var html = !!this.getElementsByTagName('a')[0] ? this.getElementsByTagName('a')[0].textContent : this.innerText; 7639 mw.$(".mw-dropdown-val", el[0]).html(html); 7640 if (triggerChange === true) { 7641 el.trigger("change") 7642 } 7643 return false;
7644 } 7645 }); 7646 } 7647 this.dataset("value", val); 7648 // }, 100); 7649 }; 7650 $.fn.commuter = function (a, b) { 7651 if (a === undefined) { 7652 return false 7653 } 7654 var b = b || function () { 7655 }; 7656 return this.each(function () { 7657 if ((this.type === 'checkbox' || this.type === 'radio') && !this.cmactivated) { 7658 this.cmactivated = true; 7659 mw.$(this).bind("change", function () { 7660 this.checked === true ? a.call(this) : b.call(this); 7661 }); 7662 } 7663 }); 7664 }; 7665 7666 7667 7668$.fn.visible = function () { 7669 return this.css("visibility", "visible").css("opacity", "1"); 7670}; 7671$.fn.visibilityDefault = function () { 7672 return this.css("visibility", "").css("opacity", ""); 7673}; 7674$.fn.invisible = function () { 7675 return this.css("visibility", "hidden").css("opacity", "0"); 7676}; 7677 7678$.fn.mwDialog = function(conf){ 7679 var el = this[0]; 7680 var isTemplate = el.nodeName === 'TEMPLATE'; 7681 7682 var options = mw.tools.elementOptions(el); 7683 var id = mw.id('mwDialog-'); 7684 var idEl = mw.id('mwDialogTemp-'); 7685 var defaults = { 7686 height: 'auto', 7687 autoHeight: true, 7688 width: 'auto' 7689 }; 7690 var settings = $.extend({}, defaults, options, conf, {closeButtonAction: 'remove'}); 7691 if(conf === 'close' || conf === 'hide' || conf === 'remove'){ 7692 if(el._dialog){ 7693 el._dialog.remove(); 7694 } 7695 return; 7696 } 7697 $(el).before('<mw-dialog-temp id="'+idEl+'"></mw-dialog-temp>'); 7698 var dialog = mw.dialog(settings); 7699 el._dialog = dialog; 7700 if(isTemplate) { 7701 dialog.dialogContainer.innerHTML = el.innerHTML; 7702 7703 } else { 7704 dialog.dialogContainer.appendChild(el); 7705 7706 } 7707 $(el).show(); 7708 if(settings.width === 'auto'){ 7709 dialog.width($(el).width); 7710 dialog.center($(el).width); 7711 } 7712 $(dialog).on('BeforeRemove', function(){ 7713 mw.$('#' + idEl).replaceWith(el); 7714 $(el).hide(); 7715 el._dialog = null; 7716 }); 7717 return this; 7718}; 7719 7720mw.ajax = function (options) { 7721 var xhr = $.ajax(options); 7722 return xhr; 7723}; 7724 7725mw.ajax = $.ajax; 7726 7727jQuery.each(["xhrGet", "xhrPost"], function (i, method) { 7728 mw[method] = function (url, data, callback, type) { 7729 if (jQuery.isFunction(data)) { 7730 type = type || callback; 7731 callback = data; 7732 data = undefined; 7733 } 7734 return mw.ajax(jQuery.extend({ 7735 url: url, 7736 type: i == 0 ? 'GET' : 'POST', 7737 dataType: type, 7738 data: data, 7739 success: callback 7740 }, jQuery.isPlainObject(url) && url)); 7741 }; 7742}); 7743 7744 7745mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/loading.js'); 7746 7747mw.tools.progressDefaults = { 7748 skin: 'mw-ui-progress', 7749 action: mw.msg.loading + '...', 7750 progress: 0 7751}; 7752 7753mw.tools.progress = function (obj) { 7754 if (typeof obj.element === 'string') { 7755 obj.element = mw.$(obj.element)[0]; 7756 } 7757 if (obj.element === null || !obj.element) return false; 7758 if (obj.element.querySelector('.mw-ui-progress-bar')) { 7759 obj.element.progressOptions.show() 7760 return obj.element.progressOptions; 7761 } 7762 obj = $.extend({}, mw.tools.progressDefaults, obj); 7763 if(obj.progress > 100 ) { 7764 obj.progress = 100; 7765 } 7766 if(obj.progress < 0 ) { 7767 obj.progress = 0; 7768 } 7769 var progress = document.createElement('div'); 7770 progress.className = obj.skin; 7771 progress.innerHTML = '<div class="mw-ui-progress-bar" style="width: ' + obj.progress + '%;"></div><div class="mw-ui-progress-info">' + obj.action + '</div><span class="mw-ui-progress-percent">'+obj.progress+'%</span>'; 7772 progress.progressInfo = obj; 7773 var options = { 7774 progress: progress, 7775 show: function () { 7776 this.progress.style.display = ''; 7777 }, 7778 hide: function () { 7779 this.progress.style.display = 'none'; 7780 }, 7781 remove: function () { 7782 progress.progressInfo.element.progressOptions = undefined; 7783 mw.$(this.progress).remove(); 7784 }, 7785 set: function (v, action) { 7786 if (v > 100) { 7787 v = 100; 7788 } 7789 if (v < 0) { 7790 v = 0; 7791 } 7792 action = action || this.progress.progressInfo.action; 7793 mw.$('.mw-ui-progress-bar', this.progress).css('width', v + '%'); 7794 mw.$('.mw-ui-progress-percent', this.progress).html(v + '%'); 7795 progress.progressInfo.element.progressOptions.show(); 7796 } 7797 }; 7798 progress.progressOptions = obj.element.progressOptions = options; 7799 obj.element.appendChild(progress); 7800 return options; 7801}; 7802 7803mw.tools.loading = function (element, progress, speed) { 7804 /* 7805 7806 progress:number 0 - 100, 7807 speed:string, -> 'slow', 'normal, 'fast' 7808 7809 mw.tools.loading(true) -> slowly animates to 95% on body 7810 mw.tools.loading(false) -> fast animates to 100% on body 7811 7812 */ 7813 function set(el, progress, speed) { 7814 speed = speed || 'normal'; 7815 mw.tools.removeClass(el, 'mw-progress-slow'); 7816 mw.tools.removeClass(el, 'mw-progress-normal'); 7817 mw.tools.removeClass(el, 'mw-progress-fast'); 7818 mw.tools.addClass(el, 'mw-progress-' + speed); 7819 element.__loadingTime = setTimeout(function () { 7820 el.querySelector('.mw-progress-index').style.width = progress + '%'; 7821 }, 10) 7822 7823 } 7824 7825 7826 if (typeof element === 'boolean') { 7827 progress = !!element; 7828 element = document.body; 7829 } 7830 if (typeof element === 'number') { 7831 progress = element; 7832 element = document.body; 7833 } 7834 if (element === document || element === document.documentElement) { 7835 element = document.body; 7836 } 7837 element = mw.$(element)[0] 7838 if (element === null || !element) return false;
7839 if (element.__loadingTime) { 7840 clearTimeout(element.__loadingTime) 7841 } 7842 mw.require('css_parser.js') 7843 7844 var isLoading = mw.tools.hasClass(element, 'mw-loading'); 7845 var el = element.querySelector('.mw-progress'); 7846 7847 if (!el) { 7848 el = document.createElement('div'); 7849 el.className = 'mw-progress'; 7850 el.innerHTML = '<div class="mw-progress-index"></div>'; 7851 if (element === document.body) el.style.position = 'fixed'; 7852 element.appendChild(el); 7853 } 7854 if (progress === 'hide') { 7855 el.remove(); 7856 return; 7857 } 7858 var pos = mw.CSSParser(element).get.position(); 7859 if (pos === 'static') { 7860 element.style.position = 'relative'; 7861 } 7862 if (progress) { 7863 if (progress === true) { 7864 set(el, 95, speed || 'slow') 7865 } 7866 else if (typeof progress === 'number') { 7867 progress = progress <= 100 ? progress : 100; 7868 progress = progress >= 0 ? progress : 0; 7869 set(el, progress, speed) 7870 } 7871 } 7872 else { 7873 if (el) { 7874 set(el, 100, speed || 'fast') 7875 } 7876 element.__loadingTime = setTimeout(function () { 7877 mw.$(element).removeClass('mw-loading-defaults mw-loading'); 7878 mw.$(el).remove() 7879 }, 700) 7880 } 7881}; 7882 7883 7884mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/loops.js'); 7885 7886(function(){ 7887 var loopTools = { 7888 loop: {/* Global index for MW loops */}, 7889 stopLoop: function (loop) { 7890 mw.tools.loop[loop] = false; 7891 }, 7892 foreachParents: function (el, callback) { 7893 if (!el) return false; 7894 var index = mw.random(); 7895 mw.tools.loop[index] = true; 7896 var _curr = el.parentNode; 7897 var count = -1; 7898 if (_curr !== null && _curr !== undefined) { 7899 var _tag = _curr.tagName; 7900 while (_tag !== 'BODY') { 7901 count++; 7902 var caller = callback.call(_curr, index, count); 7903 _curr = _curr.parentNode; 7904 if (caller === false || _curr === null || _curr === undefined || !mw.tools.loop[index]) { 7905 delete mw.tools.loop[index]; 7906 break; 7907 } 7908 _tag = _curr.tagName; 7909 } 7910 } 7911 }, 7912 foreachChildren: function (el, callback) { 7913 if (!el) return false; 7914 var index = mw.random(); 7915 mw.tools.loop[index] = true; 7916 var _curr = el.firstChild; 7917 var count = -1; 7918 if (_curr !== null && _curr !== undefined) { 7919 while (_curr.nextSibling !== null) { 7920 if (_curr.nodeType === 1) { 7921 count++; 7922 var caller = callback.call(_curr, index, count); 7923 _curr = _curr.nextSibling; 7924 if (caller === false || _curr === null || _curr === undefined || !mw.tools.loop[index]) { 7925 delete mw.tools.loop[index]; 7926 break 7927 } 7928 var _tag = _curr.tagName; 7929 } 7930 else { 7931 _curr = _curr.nextSibling; 7932 } 7933 } 7934 } 7935 } 7936 }; 7937 Object.assign(mw.tools, loopTools); 7938})(); 7939 7940 7941mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/modules-dialogs.js'); 7942 7943(function(){ 7944 var systemDialogs = { 7945 moduleFrame: function(type, params, autoHeight){ 7946 if(typeof autoHeight === 'undefined') { 7947 autoHeight = true; 7948 } 7949 params = params || {}; 7950 if(!type) return; 7951 7952 var frame = document.createElement('iframe'); 7953 frame.className = 'mw-editor-frame'; 7954 frame.allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture'; 7955 frame.allowFullscreen = true; 7956 frame.scrolling = "auto"; 7957 frame.width = "100%"; 7958 frame.frameBorder = "0"; 7959 7960 frame.src = route('live_edit.module_settings') + '?type=' + type + '¶ms=' + $.param(params).split('&').join(','); 7961 if(autoHeight) { 7962 mw.tools.iframeAutoHeight(frame) 7963 } 7964 return frame; 7965 }, 7966 confirm_reset_module_by_id: function (module_id, cb, customHtml) { 7967 7968 var html = '<div class="">' + 7969 '<h4 class="">' + mw.lang('Are you sure you want to reset this module ?') + '</h4>' + 7970 '<div class="">' + 7971 '<br>' + mw.lang('You will delete all settings of the module !') + 7972 '<br>' + mw.lang('This operation cannot be undone !') + 7973 '</div>' + 7974 '</div>'; 7975 7976 if (customHtml) { 7977 html = customHtml; 7978 } 7979 7980 mw.tools.confirm(html, function () { 7981 7982 var is_a_preset = mw.$('#'+module_id).attr('data-module-original-id'); 7983 var is_a_preset_attrs = mw.$('#'+module_id).attr('data-module-original-attrs'); 7984 if(is_a_preset){ 7985 var orig_attrs_decoded = JSON.parse(window.atob(is_a_preset_attrs)); 7986 if (orig_attrs_decoded) { 7987 mw.$('#'+module_id).removeAttr('data-module-original-id'); 7988 mw.$('#'+module_id).removeAttr('data-module-original-attrs'); 7989 mw.$('#'+module_id).removeAttr('data-module-original-attrs'); 7990 mw.$('#'+module_id).attr(orig_attrs_decoded).reload_module(); 7991 7992 if( mw.top().win.module_settings_modal_reference_preset_editor_thismodal ){ 7993 mw.top().win.module_settings_modal_reference_preset_editor_thismodal.remove(); 7994 } 7995 } 7996 return; 7997 } 7998 mw.$('#'+module_id).removeAttr('data-module-id-from-preset'); 7999 8000 var data = {}; 8001 data.modules_ids = [module_id]; 8002 8003 var childs_arr = []; 8004 mw.$('#'+module_id).andSelf().find('.edit').each(function (i) { 8005 var some_child = {}; 8006 mw.tools.removeClass(this, 'changed') 8007 some_child.rel = mw.$(this).attr('rel'); 8008 some_child.field = mw.$(this).attr('field'); 8009 childs_arr.push(some_child); 8010 }); 8011 8012 8013 mw.$('#'+module_id).andSelf().find('.module').each(function (i) { 8014 8015 var some_child = mw.$(this).attr('id'); 8016 8017 data.modules_ids.push(some_child); 8018 8019 }); 8020 8021 window.mw.on.DOMChangePause = true; 8022 var done = 0, alldone = 1; 8023 8024 if (childs_arr.length) { 8025 alldone++; 8026 $.ajax({ 8027 type: "POST", 8028 // dataType: "json", 8029 //processData: false, 8030 url: mw.settings.api_url + "content/reset_edit", 8031 data: {reset:childs_arr} 8032 // success: success, 8033 // dataType: dataType 8034 }).always(function (){ 8035 done++; 8036 if(done === alldone) { 8037 if(cb){ 8038 cb.call() 8039 } 8040 } 8041 }); 8042 } 8043 8044 8045 //data-module-original-attrs 8046 8047 $.ajax({ 8048 type: "POST", 8049 // dataType: "json", 8050 //processData: false, 8051 url: mw.settings.api_url + "content/reset_modules_settings", 8052 data: data, 8053 success: function(){ 8054 8055 setTimeout(function () { 8056 8057 8058 mw.$('#'+module_id).removeAttr('data-module-original-id'); 8059 mw.reload_module('#'+module_id); 8060 window.mw.on.DOMChangePause = false;
8061 8062 }, 1000); 8063 done++; 8064 if(done === alldone) { 8065 if(cb){ 8066 cb.call() 8067 } 8068 } 8069 8070 }, 8071 }); 8072 8073 8074 }); 8075 8076 8077 }, 8078 open_reset_content_editor: function (root_element_id) { 8079 8080 8081 8082 var moduleType = 'editor/reset_content'; 8083 var attrsForSettings = {}; 8084 8085 attrsForSettings.live_edit = true; 8086 attrsForSettings.module_settings = true; 8087 attrsForSettings.id = 'mw_global_reset_content_editor'; 8088 attrsForSettings.type = moduleType; 8089 attrsForSettings.iframe = true; 8090 attrsForSettings.from_url = mw.app.canvas.getWindow().location.href; 8091 8092 8093 var src = route('live_edit.module_settings') + "?" + json2url(attrsForSettings); 8094 8095 8096 8097 // var src = mw.settings.site_url + 'api/module?id=mw_global_reset_content_editor&live_edit=true&module_settings=true&type=editor/reset_content&autosize=true'; 8098 8099 if(typeof(root_element_id) != 'undefined') { 8100 var src = src + '&root_element_id='+root_element_id; 8101 } 8102 8103 // mw.dialogIframe({ 8104 var modal = mw.dialogIframe({ 8105 url: src, 8106 // width: 500, 8107 // height: mw.$(window).height() - (2.5 * mw.tools.TemplateSettingsModalDefaults.top), 8108 name: 'mw-reset-content-editor-front', 8109 title: 'Reset content', 8110 template: 'default', 8111 center: false, 8112 resize: true, 8113 autosize: true, 8114 autoHeight: true, 8115 draggable: true 8116 }); 8117 }, 8118 open_global_module_settings_modal: function (module_type, module_id, modalOptions, additional_params) { 8119 8120 8121 var params = {}; 8122 params.id = module_id; 8123 params.live_edit = true; 8124 params.iframe = true; 8125 params.module_settings = true; 8126 params.type = module_type; 8127 params.autosize = false; 8128 8129 var params_url = $.extend({}, params, additional_params); 8130 8131 // var src = mw.settings.site_url + "api/module?" + json2url(params_url); 8132 var src = route('live_edit.module_settings') + '?' + json2url(params_url); 8133 8134 8135 modalOptions = modalOptions || {}; 8136 8137 var defaultOpts = { 8138 url: src, 8139 // width: 500, 8140 height: 'auto', 8141 autoHeight: true, 8142 name: 'mw-module-settings-editor-front', 8143 title: 'Settings', 8144 template: 'default', 8145 center: false, 8146 resize: true, 8147 draggable: true 8148 }; 8149 8150 var settings = $.extend({}, defaultOpts, modalOptions); 8151 8152 // return mw.dialogIframe(settings); 8153 return mw.top().dialogIframe(settings); 8154 }, 8155 open_module_modal: function (module_type, params, modalOptions) { 8156 8157 var id = mw.id('module-modal-'); 8158 var id_content = id + '-content'; 8159 modalOptions = modalOptions || {}; 8160 8161 var settings = $.extend({}, { 8162 content: '<div class="module-modal-content" id="' + id_content + '"></div>', 8163 id: id 8164 }, modalOptions, {skin: 'default'}); 8165 8166 var xhr = false; 8167 var openiframe = false; 8168 if (typeof (settings.iframe) != 'undefined' && settings.iframe) { 8169 openiframe = true; 8170 } 8171 if (openiframe) { 8172 8173 var additional_params = {}; 8174 additional_params.type = module_type; 8175 var params_url = $.extend({}, params, additional_params); 8176 8177 var src = route('live_edit.module_settings') + '?' + json2url(params_url); 8178 8179 8180 var settings = { 8181 url: src, 8182 name: 'mw-module-settings-editor-front', 8183 title: 'Settings', 8184 center: false, 8185 resize: true, 8186 draggable: true, 8187 height:'auto', 8188 autoHeight: true 8189 }; 8190 return mw.top().dialogIframe(settings); 8191 8192 } else { 8193 delete settings.skin; 8194 delete settings.template; 8195 if(!settings.height){ 8196 settings.height = 'auto'; 8197 settings.autoHeight = true; 8198 } 8199 8200 settings.encapsulate = false;
8201 var modal = mw.dialog(settings); 8202 xhr = mw.load_module(module_type, '#' + id_content, function(){ 8203 setTimeout(function(){ 8204 modal.center(); 8205 },333) 8206 }, params); 8207 } 8208 8209 8210 return { 8211 xhr: xhr, 8212 modal: modal, 8213 } 8214 } 8215 }; 8216 8217 for (var i in systemDialogs) { 8218 mw.tools[i] = systemDialogs[i]; 8219 } 8220})() 8221 8222 8223mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/native-notification.js'); 8224 8225mw.tools.notification = function (body, tag, icon) { 8226 if (!body) return; 8227 var n = window.Notification || window.webkitNotification || window.mozNotification; 8228 if (typeof n == 'undefined') { 8229 return false; 8230 } 8231 if (n.permission == 'granted') { 8232 new n("MW Update", { 8233 tag: tag || "Microweber", 8234 body: body, 8235 icon: icon || mw.settings.includes_url + "img/logomark.png" 8236 }); 8237 } 8238 else if (n.permission == 'default') { 8239 n.requestPermission(function (result) { 8240 8241 if (result == 'granted') { 8242 return mw.tools.notification(body, tag, icon) 8243 } 8244 else if (result == 'denied') { 8245 mw.notification.error('Notifications are blocked') 8246 } 8247 else if (result == 'default') { 8248 mw.notification.warn('Notifications are canceled') 8249 8250 } 8251 }); 8252 } 8253} 8254 8255 8256mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/notification.js'); 8257 8258 8259 8260;(function(){ 8261 8262var defaultTimeout = 5000; 8263 8264var targetWindow = window.top; 8265var targetDocument = window.top.document; 8266 8267var errorsHandlePrev = []; 8268mw.errorsHandle = function (obj) { 8269 while (errorsHandlePrev.length) { 8270 errorsHandlePrev[errorsHandlePrev.length-1].remove(); 8271 errorsHandlePrev.pop(); 8272 } 8273 8274 if(!obj) return; 8275 if(obj.status === 401) { 8276 8277 mw.session.checkPause = false; 8278 mw.session.checkPauseExplicitly = false; 8279 mw.session.logRequest(); 8280 8281 } 8282 obj.errors = obj.errors || obj.form_errors; 8283 if(!obj.errors) { 8284 $('.invalid-feedback', targetDocument).hide(); 8285 $('.valid-feedback', targetDocument).hide(); 8286 } 8287 if(obj.errors) { 8288 var html = []; 8289 for (var key in obj.errors) { 8290 var bsel = $('.custom-file-input[name="' + key + '"], .form-control[name="' + key + '"]').last()[0] 8291 if(!bsel) { 8292 var err = obj.errors[key].map ? obj.errors[key][0] : obj.errors[key]; 8293 html.push(err); 8294 } else if ( bsel ) { 8295 var next = bsel.nextElementSibling; 8296 if (!next || !next.classList.contains('invalid-feedback')) { 8297 next = targetDocument.createElement('div'); 8298 next.classList.add('invalid-feedback'); 8299 bsel.parentNode.insertBefore(next, bsel.nextSibling); 8300 errorsHandlePrev.push(next); 8301 } 8302 next.style.display = 'block'; 8303 8304 $(next, targetDocument).css('display','block'); 8305 next.innerHTML = obj.errors[key]; 8306 } 8307 } 8308 if (html.length) { 8309 8310 mw.notification.warning(html.join('<br>')) 8311 } 8312 } 8313 if (obj.errors && obj.message) { 8314 mw.notification.warning(obj.message); 8315 } 8316}; 8317mw.notification = { 8318 msg: function (data, timeout, alert) { 8319 timeout = timeout || defaultTimeout; 8320 alert = alert || false; 8321 if (data) { 8322 8323 if(data.status) { 8324 if(data.responseJSON && data.responseJSON.message) { 8325 var conf = {}; 8326 if(data.status === 200) { 8327 conf.success = data.responseJSON.message || data.statusText; 8328 } else { 8329 conf.warning = data.responseJSON.message || data.statusText; 8330 } 8331 mw.notification.msg(conf, timeout, alert); 8332 8333 } 8334 8335 } else if (data.success) { 8336 if (alert) { 8337 mw.notification.success(data.success, timeout); 8338 } 8339 else { 8340 mw.alert(data.success); 8341 } 8342 } else if (data.error) { 8343 mw.notification.error(data.error, timeout); 8344 } else if (data.warning) { 8345 mw.notification.warning(data.warning, timeout); 8346 } 8347 } 8348 }, 8349 build: function (type, text, name) { 8350 var div = targetDocument.createElement('div'); 8351 div.id = name;
8352 div.className = 'mw-notification mw-' + type; 8353 div.innerHTML = '<div>' + text + '</div>'; 8354 return div; 8355 }, 8356 append: function (type, text, timeout, name) { 8357 8358 if(typeof type === 'object') { 8359 text = type.text; 8360 timeout = type.timeout; 8361 name = type.name; 8362 type = type.type; 8363 } 8364 8365 var tpl = ` 8366 8367 <div class="position-fixed bottom-0 end-0 p-3 mw-tblr-notification"> 8368 <div class="toast align-items-center text-bg-${type} border-0" role="alert" aria-live="assertive" aria-atomic="true"> 8369 <div class="d-flex"> 8370 <div class="toast-body"> 8371 ${text} 8372 </div> 8373 <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button> 8374 </div> 8375 </div> 8376 </div> 8377 8378 `; 8379 var last = $('.mw-tblr-notification', targetDocument).last(); 8380 if(last.length) { 8381 var btm = parseFloat(last.css('bottom')); 8382 8383 if(isNaN(btm)) { 8384 btm = 0; 8385 } 8386 btm += last.outerHeight(); 8387 } 8388 8389 tpl = $(tpl, targetDocument).appendTo(targetDocument.body); 8390 tpl.css('bottom', btm); 8391 8392 if (self !== top && window.top && window.top.bootstrap && window.top.bootstrap.Toast) { 8393 var toast = new window.top.bootstrap.Toast(tpl.children().get(0), { 8394 delay: timeout 8395 }); 8396 toast.show(); 8397 } else if (window.bootstrap && window.bootstrap.Toast) { 8398 var toast = new window.bootstrap.Toast(tpl.children().get(0), { 8399 delay: timeout 8400 }); 8401 toast.show(); 8402 } 8403 8404 8405 8406 }, 8407 success: function (text, timeout, name) { 8408 if ( typeof text === 'object' ) { 8409 timeout = text.timeout; 8410 name = text.name; 8411 text = text.text; 8412 } 8413 timeout = timeout || defaultTimeout; 8414 mw.notification.append('success', text, timeout, name); 8415 }, 8416 error: function (text, timeout, name) { 8417 if ( typeof text === 'object' ) { 8418 timeout = text.timeout; 8419 name = text.name; 8420 text = text.text; 8421 } 8422 timeout = timeout || defaultTimeout; 8423 mw.notification.append('danger', text, timeout, name); 8424 }, 8425 warning: function (text, timeout, name) { 8426 if ( typeof text === 'object' ) { 8427 timeout = text.timeout; 8428 name = text.name; 8429 text = text.text; 8430 } 8431 timeout = timeout || defaultTimeout; 8432 mw.notification.append('warning', text, timeout, name); 8433 } 8434}; 8435 8436 8437})(); 8438 8439 8440 8441 8442mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/objects.js'); 8443 8444mw.object = { 8445 extend: function () { 8446 var extended = {}; 8447 var deep = false; 8448 var i = 0; 8449 var l = arguments.length; 8450 8451 if ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) { 8452 deep = arguments[0]; 8453 i++; 8454 } 8455 var merge = function (obj) { 8456 for ( var prop in obj ) { 8457 if ( Object.prototype.hasOwnProperty.call( obj, prop ) ) { 8458 if ( deep && Object.prototype.toString.call(obj[prop]) === '[object Object]' ) { 8459 extended[prop] = mw.object.extend( true, extended[prop], obj[prop] ); 8460 } else { 8461 extended[prop] = obj[prop]; 8462 } 8463 } 8464 } 8465 }; 8466 for ( ; i < l; i++ ) { 8467 var obj = arguments[i]; 8468 merge(obj); 8469 } 8470 return extended; 8471 8472 } 8473}; 8474 8475 8476mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/responsive.js'); 8477 8478mw.responsive = { 8479 table: function (selector, options) { 8480 options = options || {}; 8481 mw.$(selector).each(function () { 8482 var cls = 'responsive-table-' + mw.random(); 8483 mw.tools.addClass(this, cls); 8484 var el = mw.$(this); 8485 el.wrap('<div class="mw-responsive-table-wrapper"></div>'); 8486 if (options.minWidth) { 8487 el.css('minWidth', options.minWidth) 8488 } 8489 if (!el.hasClass('mw-mobile-table')) { 8490 el.addClass('mw-mobile-table'); 8491 } 8492 }); 8493 } 8494}; 8495 8496 8497mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/select.js'); 8498 8499/* 8500 options.data = [ 8501 { 8502 title: string, 8503 value: any, 8504 icon?: string, 8505 selected?: boolean 8506 } 8507 ] 8508 8509 */ 8510 8511 8512mw.Select = function(options) { 8513 var defaults = { 8514 data: [], 8515 skin: 'default', 8516 multiple: false, 8517 autocomplete: false, 8518 mobileAutocomplete: false, 8519 showSelected: false, 8520 document: document, 8521 size: 'normal', 8522 color: 'default', 8523 dropMode: 'over', // 'over' | 'push' 8524 placeholder: mw.lang('Select'), 8525 tags: false, // only if multiple is set to true, 8526 ajaxMode: { 8527 paginationParam: 'page', 8528 searchParam: 'keyword', 8529 endpoint: null, 8530 method: 'get' 8531 } 8532 }; 8533 options = options || {}; 8534 this.settings = $.extend({}, defaults, options); 8535 8536 var _e = {}; 8537 this.on = function (e, f) { _e[e] ? _e[e].push(f) : (_e[e] = [f]); return this; }; 8538 this.dispatch = function (e, f) { _e[e] ? _e[e].forEach(function (c){ c.call(this, f); }) : ''; return this; }; 8539 8540 if(this.settings.ajaxMode && !this.settings.ajaxMode.endpoint){ 8541 this.settings.ajaxMode = false;
8542 } 8543 8544 this.$element = $(this.settings.element).eq(0); 8545 this.element = this.$element[0]; 8546 8547 if(!this.element) { 8548 return; 8549 } 8550 8551 this._rootInputMode = this.element.nodeName === 'INPUT'; 8552 8553 if(this.element._mwSelect) { 8554 return this.element._mwSelect; 8555 } 8556 8557 var scope = this; 8558 this.document = this.settings.document; 8559 8560 this._value = null; 8561 8562 8563 this.getLabel = function(item) { 8564 return item.title || item.name || item.label || item.value; 8565 }; 8566 8567 this._loading = false; 8568 8569 this._page = 1; 8570 8571 this.nextPage = function () { 8572 this._page++; 8573 }; 8574 8575 this.page = function (state) { 8576 if (typeof state === 'undefined') { 8577 return this._page; 8578 } 8579 this._page = state; 8580 }; 8581 8582 this.loading = function (state) { 8583 if (typeof state === 'undefined') { 8584 return this._state; 8585 } 8586 this._state = state; 8587 mw.tools.classNamespaceDelete(this.root, 'mw-select-loading-'); 8588 mw.tools.addClass(this.root, 'mw-select-loading-' + state); 8589 }; 8590 8591 this.xhr = null; 8592 8593 this.ajaxFilter = function (val, callback) { 8594 if (this.xhr) { 8595 this.xhr.abort(); 8596 } 8597 val = (val || '').trim().toLowerCase(); 8598 var params = { }; 8599 params[this.settings.ajaxMode.searchParam] = val; 8600 params = (this.settings.ajaxMode.endpoint.indexOf('?') === -1 ? '?' : '&' ) + $.param(params); 8601 this.xhr = $[this.settings.ajaxMode.method](this.settings.ajaxMode.endpoint + params, function (data) { 8602 callback.call(this, data); 8603 scope.xhr = null; 8604 }); 8605 }; 8606 8607 this.filter = function (val) { 8608 val = (val || '').trim().toLowerCase(); 8609 if (this.settings.ajaxMode) { 8610 this.loading(true); 8611 this.ajaxFilter(val, function (data) { 8612 scope.setData(data.data); 8613 if(data.data && data.data.length){ 8614 scope.open(); 8615 } else { 8616 scope.close(); 8617 } 8618 scope.loading(false); 8619 }); 8620 } else { 8621 var all = this.root.querySelectorAll('.mw-select-option'), i = 0; 8622 if (!val) { 8623 for( ; i< all.length; i++) { 8624 all[i].style.display = ''; 8625 } 8626 } else { 8627 for( ; i< all.length; i++) { 8628 all[i].style.display = this.getLabel(all[i].$value).toLowerCase().indexOf(val) !== -1 ? '' : 'none'; 8629 } 8630 } 8631 } 8632 }; 8633 8634 this.setPlaceholder = function (plval) { 8635 /*plval = plval || this.settings.placeholder; 8636 if(scope.settings.autocomplete){ 8637 $('.mw-ui-invisible-field', this.root).attr('placeholder', plval); 8638 } else { 8639 $('.mw-ui-btn-content', this.root).html(plval); 8640 }*/ 8641 return this.displayValue(plval) 8642 }; 8643 this.displayValue = function(plval){ 8644 if(typeof plval === 'undefined' && !this.settings.multiple && this.value()) { 8645 plval = scope.getLabel(this.value()); 8646 } 8647 plval = typeof plval === 'undefined' ? this.settings.placeholder : plval; 8648 if(!scope._displayValue) { 8649 scope._displayValue = scope.document.createElement('span'); 8650 scope._displayValue.className = 'mw-select-display-value mw-ui-size-' + this.settings.size; 8651 $('.mw-select-value', this.root).append(scope._displayValue); 8652 } 8653 if(this._rootInputMode){ 8654 scope._displayValue.innerHTML = ' '; 8655 $('input.mw-ui-invisible-field', this.root).val(plval); 8656 8657 } else { 8658 scope._displayValue.innerHTML = plval + this.__indicateNumber(); 8659 8660 } 8661 }; 8662 8663 this.__indicateNumber = function () { 8664 if(this.settings.multiple && this.value() && this.value().length){ 8665 return "<span class='mw-select-indicate-number'>" + this.value().length + "</span>"; 8666 } else { 8667 return "<span class='mw-select-indicate-number mw-select-indicate-number-empty'>" + 0 + "</span>"; 8668 } 8669 }; 8670 8671 this.rend = { 8672 8673 option: function(item){ 8674 var oh = scope.document.createElement('label'); 8675 oh.$value = item; 8676 oh.className = 'mw-select-option'; 8677 if (scope.settings.multiple) { 8678 oh.className = 'mw-ui-check mw-select-option'; 8679 oh.innerHTML = '<input type="checkbox"><span></span><span>'+scope.getLabel(item)+'</span>'; 8680 8681 $('input', oh).on('change', function () { 8682 this.checked ? scope.valueAdd(oh.$value) : scope.valueRemove(oh.$value) 8683 }); 8684 } else { 8685 oh.innerHTML = scope.getLabel(item); 8686 oh.onclick = function () { 8687 scope.value(oh.$value) 8688 }; 8689 } 8690 return oh; 8691 }, 8692 value: function() { 8693 var tag = 'span', cls = 'mw-ui-btn form-select'; 8694 if(scope.settings.autocomplete){ 8695 tag = 'span'; 8696 cls = 'mw-ui-field'; 8697 } 8698 var oh = scope.document.createElement(tag); 8699 oh.className = cls + ' mw-ui-size-' + scope.settings.size + ' mw-ui-bg-' + scope.settings.color + ' mw-select-value';
8700 8701 if(scope.settings.autocomplete){ 8702 oh.innerHTML = '<input type="text" class="mw-ui-invisible-field mw-ui-field-' + scope.settings.size + '">'; 8703 } else { 8704 oh.innerHTML = '<span class="mw-ui-btn-content"></span>'; 8705 } 8706 8707 if(scope.settings.autocomplete){ 8708 $('input', oh) 8709 .on('input focus', function (e) { 8710 scope.filter(this.value); 8711 if(scope._rootInputMode) { 8712 scope.element.value = this.value; 8713 8714 } 8715 }) 8716 .on('keydown', function (e) { 8717 if(mw.event.is.enter(e) || mw.event.is.comma(e)) { 8718 e.preventDefault(); 8719 $(scope).trigger('enterOrComma', [this, e]); 8720 $(this).val('adsadasd') 8721 } 8722 }) 8723 .on('focus', function () { 8724 if(scope.settings.data && scope.settings.data.length) { 8725 scope.open(); 8726 } 8727 }).on('focus blur input', function () { 8728 var hasVal = !!this.value.trim(); 8729 mw.tools[hasVal ? 'addClass' : 'removeClass'](scope.root, 'mw-select-has-value') 8730 }); 8731 } else { 8732 oh.onclick = function () { 8733 scope.toggle(); 8734 }; 8735 } 8736 return oh; 8737 }, 8738 options: function(){ 8739 scope.optionsHolder = scope.document.createElement('div'); 8740 scope.holder = scope.document.createElement('div'); 8741 scope.optionsHolder.className = 'mw-select-options'; 8742 var options = []; 8743 $.each(scope.settings.data, function(){ 8744 var opt = scope.rend.option(this); 8745 options.push(opt); 8746 scope.holder.appendChild(opt); 8747 }); 8748 scope.optionsHolder.appendChild(scope.holder); 8749 8750 setTimeout(function (){ 8751 scope.dispatch('optionsReady', options) 8752 }, 10) 8753 8754 return scope.optionsHolder; 8755 }, 8756 root: function () { 8757 scope.root = scope.document.createElement('div'); 8758 scope.root.className = 'mw-select mw-select-dropmode-' + scope.settings.dropMode + ' mw-select-multiple-' + scope.settings.multiple; 8759 8760 return scope.root; 8761 } 8762 }; 8763 8764 this.state = 'closed'; 8765 8766 this.open = function () { 8767 this.state = 'opened'; 8768 mw.tools.addClass(scope.root, 'active'); 8769 mw.Select._register.forEach(function (item) { 8770 if(item !== scope) { 8771 item.close() 8772 } 8773 }); 8774 }; 8775 8776 this.close = function () { 8777 this.state = 'closed'; 8778 mw.tools.removeClass(scope.root, 'active'); 8779 }; 8780 8781 this.tags = function () { 8782 if(!this._tags) { 8783 if(this.settings.multiple && this.settings.tags) { 8784 var holder = scope.document.createElement('div'); 8785 holder.className = 'mw-select-tags'; 8786 this._tags = new mw.tags({element:holder, data:scope._value || [], color: this.settings.tagsColor, size: this.settings.tagsSize || 'small'}) 8787 $(this.optionsHolder).prepend(holder); 8788 mw.$(this._tags).on('tagRemoved', function (e, tag) { 8789 scope.valueRemove(tag) 8790 }) 8791 } 8792 } else { 8793 this._tags.setData(scope._value) 8794 } 8795 this.displayValue() 8796 }; 8797 8798 8799 this.toggle = function () { 8800 if (this.state === 'closed') { 8801 this.open(); 8802 } else { 8803 this.close(); 8804 } 8805 }; 8806 8807 8808 this._valueGet = function (val) { 8809 if(typeof val === 'number') { 8810 val = this.settings.data.find(function (item) { 8811 return item.id === val; 8812 }) 8813 } 8814 return val; 8815 }; 8816 8817 8818 8819 this.valueAdd = function(val){ 8820 if (!val) return; 8821 val = this._valueGet(val); 8822 if (!val) return; 8823 if (!this._value) { 8824 this._value = [] 8825 } 8826 var exists = this._value.find(function (item) { 8827 return item.id === val.id; 8828 }); 8829 if (!exists) { 8830 this._value.push(val); 8831 $(this.root.querySelectorAll('.mw-select-option')).each(function () { 8832 if(this.$value === val) { 8833 this.querySelector('input').checked = true; 8834 } 8835 }); 8836 } 8837 8838 this.afterChange(); 8839 }; 8840 8841 this.afterChange = function () { 8842 this.tags(); 8843 this.displayValue(); 8844 if($.isArray(this._value)) { 8845 $.each(this._value, function () { 8846 8847 }); 8848 $(this.root.querySelectorAll('.mw-select-option')).each(function () { 8849 if(scope._value.indexOf(this.$value) !== -1) { 8850 mw.tools.addClass(this, 'active') 8851 } 8852 else { 8853 mw.tools.removeClass(this, 'active') 8854 } 8855 }); 8856 } 8857 $(this).trigger('change', [this._value]); 8858 this.dispatch('change', [this._value]) 8859 }; 8860 8861 this.valueRemove = function(val) { 8862 if (!val) return; 8863 val = this._valueGet(val); 8864 if (!val) return; 8865 if (!this._value) { 8866 this._value = []; 8867 } 8868 var exists = this._value.find(function (item) { 8869 return item.id === val.id; 8870 }); 8871 if (exists) { 8872 this._value.splice(this._value.indexOf(exists), 1); 8873 } 8874 $(this.root.querySelectorAll('.mw-select-option')).each(function () { 8875 if(this.$value === val) { 8876 this.querySelector('input').checked = false;
8877 } 8878 }); 8879 this.afterChange() 8880 }; 8881 8882 this._valueToggle = function(val){ 8883 if (!val) return; 8884 if (!this._value) { 8885 this._value = []; 8886 } 8887 var exists = this._value.find(function (item) { 8888 return item.id === val.id; 8889 }); 8890 if (exists) { 8891 this._value.splice(this._value.indexOf(exists), 1); 8892 } else { 8893 this._value.push(val); 8894 } 8895 this.afterChange(); 8896 }; 8897 8898 this.value = function(val){ 8899 if(!val) return this._value; 8900 val = this._valueGet(val); 8901 if (!val) return; 8902 if(this.settings.multiple){ 8903 this._valueToggle(val) 8904 } 8905 else { 8906 this._value = val; 8907 $('.mw-ui-invisible-field', this.root).val(this.getLabel(val)) 8908 this.close(); 8909 } 8910 8911 this.afterChange() 8912 }; 8913 8914 this.setData = function (data) { 8915 $(scope.holder).empty(); 8916 scope.settings.data = data; 8917 var options = [] 8918 $.each(scope.settings.data, function(){ 8919 var opt = scope.rend.option(this) 8920 options.push(opt) 8921 scope.holder.appendChild(opt) 8922 }); 8923 setTimeout(function (){ 8924 scope.dispatch('optionsReady', options) 8925 }, 10) 8926 return scope.holder; 8927 }; 8928 8929 this.addData = function (data) { 8930 $.each(data, function(){ 8931 scope.settings.data.push(this); 8932 scope.holder.appendChild(scope.rend.option(this)); 8933 }); 8934 return scope.holder; 8935 }; 8936 8937 this.build = function () { 8938 this.rend.root(); 8939 this.root.appendChild(this.rend.value()); 8940 this.root.appendChild(this.rend.options()); 8941 if (this._rootInputMode) { 8942 this.element.type = 'hidden'; 8943 this.$element.before(this.root); 8944 } else { 8945 this.$element.html(this.root); 8946 } 8947 this.setPlaceholder(); 8948 mw.Select._register.push(this); 8949 }; 8950 8951 this.init = function () { 8952 this.build(); 8953 this.element._mwSelect = this; 8954 }; 8955 8956 8957 8958 this.init(); 8959 8960 8961}; 8962 8963mw.Select._register = []; 8964 8965 8966$(document).ready(function () { 8967 $(document).on('mousedown touchstart', function (e) { 8968 if(!mw.tools.firstParentOrCurrentWithClass(e.target, 'mw-select')){ 8969 mw.Select._register.forEach(function (item) { 8970 item.close(); 8971 }); 8972 } 8973 }); 8974}); 8975 8976 8977mw.select = function(options) { 8978 return new mw.Select(options); 8979}; 8980 8981 8982mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/spinner.js'); 8983 8984mw.Spinner = function(options){ 8985 if(!options || !options.element){ 8986 return; 8987 } 8988 this.$element = $(options.element); 8989 if(!this.$element.length) return; 8990 this.element = this.$element[0]; 8991 if(this.element._mwSpinner){ 8992 return this.element._mwSpinner; 8993 } 8994 this.element._mwSpinner = this; 8995 this.options = options; 8996 8997 this.options.size = this.options.size || 20; 8998 this.options.color = this.options.color || '#4592ff'; 8999 this.options.insertMode = this.options.insertMode || 'append'; 9000 9001 this.color = function(val){ 9002 if(!val) { 9003 return this.options.color; 9004 } 9005 this.options.color = val; 9006 this.$spinner.find('circle').css({ 9007 stroke: this.options.color 9008 }); 9009 }; 9010 9011 this.size = function(val){ 9012 if(!val) { 9013 return this.options.size; 9014 } 9015 this.options.size = parseFloat(val); 9016 this.$spinner.css({ 9017 width: this.options.size, 9018 height: this.options.size 9019 }); 9020 }; 9021 9022 this.setState = function(state) { 9023 mw.tools.classNamespaceDelete(this.$spinner[0], 'mw-spinner-state-'); 9024 mw.tools.addClass(this.$spinner[0], 'mw-spinner-state-' + state); 9025 } 9026 9027 this.create = function(){
9028 this.$spinner = $('<div class="mw-spinner mw-spinner-mode-' + this.options.insertMode + '" style="display: none;"><svg viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle><path class="mw-spinner-checkmark-check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg></div>'); 9029 this.size(this.options.size); 9030 this.color(this.options.color); 9031 this.$element[this.options.insertMode](this.$spinner); 9032 this.show(); 9033 return this; 9034 }; 9035 9036 this.show = function(){ 9037 this.$spinner.show(); 9038 this.$element.addClass('has-mw-spinner'); 9039 if(this.options.decorate) { 9040 this.$element.addClass('mw-spinner-decorate'); 9041 } 9042 return this; 9043 }; 9044 9045 this.hide = function(){ 9046 this.$spinner.hide(); 9047 this.$element.removeClass('has-mw-spinner'); 9048 if(this.options.decorate) { 9049 this.$element.removeClass('mw-spinner-decorate'); 9050 } 9051 return this; 9052 }; 9053 9054 this.remove = function(){ 9055 this.hide(); 9056 this.$spinner.remove(); 9057 delete this.element._mwSpinner; 9058 }; 9059 9060 this.create().show(); 9061 9062}; 9063 9064mw.spinner = function(options){ 9065 return new mw.Spinner(options); 9066}; 9067 9068 9069mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/storage.js'); 9070 9071 9072 9073mw.storage = { 9074 init: function () { 9075 9076 try { 9077 if (window.location.href.indexOf('data:') === 0 || !('localStorage' in mww) || /* IE Security configurations */ typeof mww['localStorage'] === 'undefined') return false; 9078 var lsmw = localStorage.getItem("mw"); 9079 if (typeof lsmw === 'undefined' || lsmw === null) { 9080 lsmw = localStorage.setItem("mw", "{}"); 9081 } 9082 this.change("INIT"); 9083 return lsmw; 9084 9085 } catch (error) { 9086 console.log(error); 9087 } 9088 9089 9090 }, 9091 identity: function () { 9092 if(!mw._storageIdentity) { 9093 mw._storageIdentity = 'mw-' + Date.now(); 9094 } 9095 return mw._storageIdentity; 9096 }, 9097 rootIdentity: function () { 9098 if(!mw.top()._storageIdentity) { 9099 mw.top()._storageIdentity = 'mw-' + Date.now(); 9100 } 9101 return mw.top()._storageIdentity; 9102 }, 9103 set: function (key, val) { 9104 try { 9105 if (!('localStorage' in mww)) return false; 9106 var curr = JSON.parse(localStorage.getItem("mw")); 9107 curr[key] = val; 9108 var a = localStorage.setItem("mw", JSON.stringify(curr)); 9109 mw.storage.change("CALL", key, val); 9110 return a; 9111 } catch (error) { 9112 console.log(error); 9113 } 9114 9115 }, 9116 get: function (key) { 9117 try { 9118 if (!('localStorage' in mww)) return false; 9119 var curr = JSON.parse(localStorage.getItem("mw")); 9120 return curr[key]; 9121 } catch (error) { 9122 console.log(error); 9123 } 9124 }, 9125 _keys: {}, 9126 change: function (key, callback, other) { 9127 if (!('localStorage' in mww)) return false; 9128 if (key === 'INIT' && 'addEventListener' in document) { 9129 addEventListener('storage', function (e) { 9130 if (e.key === 'mw') { 9131 9132 9133 9134 9135 9136 9137 var _new = JSON.parse(e.newValue || {}); 9138 var _old = JSON.parse(e.oldValue || {}); 9139 var diff = mw.tools.getDiff(_new, _old); 9140 for (var t in diff) { 9141 if (t in mw.storage._keys) { 9142 var i = 0, l = mw.storage._keys[t].length; 9143 for (; i < l; i++) { 9144 mw.storage._keys[t][i].call(undefined, diff[t]); 9145 } 9146 } 9147 } 9148 } 9149 }, false); 9150 } 9151 else if (key === 'CALL') { 9152 if (!document.isHidden() && typeof mw.storage._keys[callback] !== 'undefined') { 9153 var i = 0, l = mw.storage._keys[callback].length; 9154 for (; i < l; i++) { 9155 mw.storage._keys[callback][i].call(other); 9156 } 9157 } 9158 } 9159 else { 9160 if (key in mw.storage._keys) { 9161 mw.storage._keys[key].push(callback); 9162 } 9163 else { 9164 mw.storage._keys[key] = [callback]; 9165 } 9166 } 9167 } 9168};
9169mw.storage.init(); 9170 9171 9172mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/system-dialogs.js'); 9173 9174mw.tools.alert = function (text) { 9175 9176 var html = '' 9177 + '<div class="mw_alert">' 9178 + '<div class="mw-alert-holder">' + text + '</div>' 9179 + '<div><span class="btn btn-primary mb-2" onclick="mw.dialog.remove(this);"><b>' + mw.msg.ok + '</b></span></div>' 9180 + '</div>'; 9181 9182 if (mw.$("#mw_alert").length === 0) { 9183 return mw.dialog({ 9184 html: html, 9185 width: 400, 9186 height: "auto", 9187 overlay: false, 9188 name: "mw_alert", 9189 template: "mw_modal_basic" 9190 }); 9191 } 9192 else { 9193 mw.$("#mw_alert .mw-alert-holder").html(text); 9194 return mw.$("#mw_alert")[0].modal; 9195 } 9196}; 9197 9198 9199mw.tools.prompt = function (q, callback, currentVal) { 9200 if(!q) return ; 9201 9202 var input = document.createElement('input'); 9203 input.className = 'mw-ui-field w100'; 9204 9205 9206 var question = mw.$('<div class="mw-prompt-input-container"><label class="mw-ui-label">'+q+'</label></div>'); 9207 question.append(input) 9208 var footer = mw.$('<div class="mw-prompt-input-footer">'); 9209 var ok = mw.$('<button type="button" disabled class="mw-ui-btn mw-ui-btn-info">'+mw.lang('OK')+'</button>'); 9210 var cancel = mw.$('<span class="mw-ui-btn">'+mw.lang('Cancel')+'</span>'); 9211 footer.append(cancel); 9212 footer.append(ok); 9213 console.log(mw.top()) 9214 var dialog = mw.top().dialog({ 9215 content: question, 9216 title: q, 9217 footer: footer 9218 }); 9219 ok.on('click', function (){ 9220 callback.call(window, input.value); 9221 dialog.remove(); 9222 }); 9223 cancel.on('click', function (){ 9224 dialog.remove(); 9225 }); 9226 if(currentVal) { 9227 input.value = currentVal.trim() 9228 } 9229 setTimeout(function (){ 9230 input.focus(); 9231 }, 50); 9232 input.oninput = function () { 9233 var val = this.value.trim(); 9234 ok[0].disabled = !val; 9235 }; 9236 input.onkeydown = function (e) { 9237 if (mw.event.is.enter(e)) { 9238 var val = this.value.trim(); 9239 if (val) { 9240 callback.call(window, input.value); 9241 dialog.remove(); 9242 } 9243 9244 } 9245 }; 9246 9247 return dialog; 9248}; 9249mw.tools.confirm = function (question, callback, onCancel) { 9250 if(typeof question === 'function') { 9251 callback = question; 9252 question = 'Are you sure?'; 9253 } 9254 question = question || 'Are you sure?'; 9255 var html = '' 9256 + '<div class="mw_alert">' 9257 + '<div class="mw-alert-holder">' + question + '</div>' 9258 + '</div>'; 9259 9260 var ok = mw.top().$('<span tabindex="99999" class="btn btn-primary mb-3">' + mw.msg.ok + '</span>'); 9261 var cancel = mw.top().$('<span class="btn btn-link ">' + mw.msg.cancel + '</span>'); 9262 var modal; 9263 9264 if (mw.$("#mw_confirm_modal").length === 0) { 9265 modal = mw.top().dialog({ 9266 content: html, 9267 width: 400, 9268 height: 'auto', 9269 autoHeight: true, 9270 overlay: true, 9271 name: "mw_confirm_modal", 9272 footer: [cancel, ok], 9273 title: mw.lang('Confirm') 9274 }); 9275 9276 } 9277 else { 9278 mw.$("#mw_confirm_modal .mw-alert-holder").html(question); 9279 modal = mw.$("#mw_confirm_modal")[0].modal; 9280 } 9281 9282 ok.on('keydown', function (e) { 9283 if (e.keyCode === 13 || e.keyCode === 32) { 9284 callback.call(window); 9285 modal.remove(); 9286 e.preventDefault(); 9287 } 9288 }); 9289 if(modal.dialogHeader) { 9290 var close = modal.dialogHeader.querySelector('.mw-dialog-close'); 9291 if(close){ 9292 close.addEventListener('click', function (){ 9293 if(onCancel) { 9294 onCancel.call(); 9295 } 9296 }); 9297 } 9298 } 9299 9300 9301 cancel.on('click', function () { 9302 if(onCancel) { 9303 onCancel.call() 9304 } 9305 modal.remove(); 9306 }); 9307 ok.on('click', function () { 9308 callback.call(window); 9309 setTimeout(function () { 9310 modal.remove(); 9311 }, 78); 9312 }); 9313 setTimeout(function () { 9314 mw.$(ok).focus(); 9315 }, 120); 9316 return modal; 9317 }; 9318 9319 9320mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/tabs.js'); 9321 9322mw.tools.tabGroup = function (obj, element, model) { 9323 /* 9324 * 9325 * { 9326 * linkable: 'link' | 'auto', 9327 * nav: string 9328 * tabs: string 9329 * onclick: function 9330 * } 9331 * 9332 * */ 9333 element = element || document.body; 9334 model = typeof model === 'undefined' ? true : model; 9335 if (model) { 9336 model = { 9337 set: function (i) { 9338 if (typeof i === 'number') { 9339 if (!$(obj.nav).eq(i).hasClass(active)) { 9340 mw.$(obj.nav).removeClass(active); 9341 mw.$(obj.nav).eq(i).addClass(active); 9342 mw.$(obj.tabs).hide().eq(i).show(); 9343 } 9344 } 9345 }, 9346 setLastClicked: function () { 9347 if ((typeof(obj.lastClickedTabIndex) != 'undefined') && obj.lastClickedTabIndex !== null) { 9348 this.set(obj.lastClickedTabIndex); 9349 } 9350 }, 9351 unset: function (i) { 9352 if (typeof i === 'number') { 9353 if ($(obj.nav).eq(i).hasClass(active)) { 9354 mw.$(obj.nav).eq(i).removeClass(active); 9355 mw.$(obj.tabs).hide().eq(i).hide(); 9356 } 9357 } 9358 }, 9359 toggle: function (i) { 9360 if (typeof i === 'number') { 9361 if ($(obj.nav).eq(i).hasClass(active)) { 9362 this.unset(i); 9363 } 9364 else { 9365 this.set(i); 9366 } 9367 } 9368 } 9369 }; 9370 } 9371 var active = obj.activeNav || obj.activeClass || "active active-info", 9372 firstActive = 0; 9373 9374 obj.lastClickedTabIndex = null; 9375 9376 if (obj.linkable) { 9377 9378 9379 if (obj.linkable === 'link') { 9380 9381 } else if (typeof obj.linkable === 'string') { 9382 $(window).on('load hashchange', function () { 9383 var param = mw.url.windowHashParam(obj.linkable); 9384 if(param) { 9385 var el = $('[data-' + obj.linkable + '="' + param + '"]'); 9386 } 9387 }); 9388 $(obj.nav).each(function (i) { 9389 this.dataset.linkable = obj.linkable + '-' + i; 9390 (function (linkable, i) { 9391 this.onclick = function () { 9392 mw.url.windowHashParam(linkable, i); 9393 }; 9394 })(obj.linkable, i); 9395 }); 9396 } 9397 } 9398 9399 9400 mw.$(obj.nav).on('click', function (e) { 9401 if (obj.linkable) { 9402 if (obj.linkable === 'link') { 9403 9404 } 9405 } else { 9406 if (!$(this).hasClass(active)) { 9407 var i = mw.tools.index(this, mw.$(obj.nav).get(), mw.$(obj.nav)[0].nodeName); 9408 mw.$(obj.nav).removeClass(active); 9409 mw.$(this).addClass(active); 9410 mw.$(obj.tabs).hide().eq(i).show(); 9411 obj.lastClickedTabIndex = i; 9412 if (typeof obj.onclick === 'function') { 9413 obj.onclick.call(this, mw.$(obj.tabs).eq(i)[0], e, i); 9414 } 9415 } 9416 else { 9417 if (obj.toggle === true) { 9418 mw.$(this).removeClass(active); 9419 mw.$(obj.tabs).hide(); 9420 if (typeof obj.onclick === 'function') { 9421 var i = mw.tools.index(this, element, obj.nav); 9422 obj.onclick.call(this, mw.$(obj.tabs).eq(i)[0], e, i); 9423 } 9424 } 9425 } 9426 } 9427 9428 9429 return false;
9430 }).each(function (i) { 9431 if (mw.tools.hasClass(this, active)) { 9432 firstActive = i; 9433 } 9434 }); 9435 model.set(firstActive); 9436 return model; 9437}; 9438 9439 9440mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/tooltip.js'); 9441 9442(function(){ 9443 9444 var ToolTip = function (options) { 9445 options = options || {}; 9446 9447 var defaults = { 9448 template: 'default', 9449 overlay: false, 9450 position: 'bottom-center' 9451 }; 9452 9453 var scope = this; 9454 9455 this.settings = mw.object.extend({}, defaults, options); 9456 if (this.settings.skin ) { 9457 this.settings.template = this.settings.skin; 9458 } 9459 9460 var create = function () { 9461 var tpl = scope.settings.template.indexOf('mw-tooltip') === 0 ? scope.settings.template : 'mw-tooltip mw-tooltip-' + scope.settings.template; 9462 tpl += ' mw-tooltip-widget'; 9463 scope.tooltip = mw.element({ 9464 tag: 'div', 9465 props: { 9466 className: tpl, 9467 id: scope.settings.id || mw.id('mw-tooltip-') 9468 } 9469 }); 9470 scope.tooltip.get(0)._mwtooltip = scope; 9471 if ( scope.settings.overlay) {
9472 scope.overlay = mw.element({ 9473 tag: 'div', 9474 props: { 9475 className: 'mw-tooltip-overlay', 9476 } 9477 }); 9478 scope.overlay.on('mousedown touchstart', function (){ 9479 scope.remove() 9480 }); 9481 } 9482 mw.element('body') 9483 .append(scope.overlay) 9484 .append(scope.tooltip); 9485 scope.content(scope.settings.content); 9486 }; 9487 9488 var _e = {}; 9489 9490 this.on = function (e, f) { _e[e] ? _e[e].push(f) : (_e[e] = [f]) }; 9491 9492 this.dispatch = function (e, f) { _e[e] ? _e[e].forEach(function (c){ c.call(this, f); }) : ''; }; 9493 9494 this.content = function (content) { 9495 if (typeof content === 'undefined') { 9496 return scope.tooltip.innerHTML; 9497 } 9498 scope.tooltip.html(content || '') ; 9499 }; 9500 9501 this.remove = function () { 9502 this.tooltip.remove(); 9503 if (this.overlay) { 9504 this.overlay.remove(); 9505 } 9506 this.dispatch('removed'); 9507 }; 9508 this.show = function () { 9509 this.tooltip.show(); 9510 if (this.overlay) { 9511 this.overlay.show(); 9512 } 9513 this.dispatch('show'); 9514 }; 9515 this.hide = function () { 9516 this.tooltip.hide(); 9517 if (this.overlay) { 9518 this.overlay.hide(); 9519 } 9520 this.dispatch('hide'); 9521 }; 9522 9523 this._position = null; 9524 this.position = function (position, target) { 9525 position = position || this._position || this.settings.position; 9526 if (target) { 9527 scope.settings.element = target; 9528 } 9529 var el = mw.$(scope.settings.element); 9530 9531 if (el.length === 0) { 9532 return false; 9533 } 9534 var tooltip = this.tooltip.get(0); 9535 var w = el.outerWidth(), 9536 tipwidth = mw.$(tooltip).outerWidth(), 9537 h = el.outerHeight(), 9538 tipheight = mw.$(tooltip).outerHeight(), 9539 off = el.offset(); 9540 if (off.top === 0 && off.left === 0) { 9541 off = el.parent().offset(); 9542 } 9543 mw.tools.removeClass(tooltip, this._position); 9544 mw.tools.addClass(tooltip, position); 9545 this._position = position 9546 9547 9548 off.left = off.left > 0 ? off.left : 0; 9549 off.top = off.top > 0 ? off.top : 0; 9550 9551 var leftCenter = off.left - tipwidth / 2 + w / 2; 9552 leftCenter = leftCenter > 0 ? leftCenter : 0; 9553 9554 if (position === 'bottom-left') { 9555 mw.$(tooltip).css({ 9556 top: off.top + h, 9557 left: off.left 9558 }); 9559 } 9560 else if (position === 'bottom-center') { 9561 mw.$(tooltip).css({ 9562 top: off.top + h, 9563 left: leftCenter 9564 }); 9565 } 9566 else if (position === 'bottom-right') { 9567 mw.$(tooltip).css({ 9568 top: off.top + h, 9569 left: off.left - tipwidth + w 9570 }); 9571 } 9572 else if (position === 'top-right') { 9573 mw.$(tooltip).css({ 9574 top: off.top - tipheight - arrheight, 9575 left: off.left - tipwidth + w 9576 }); 9577 } 9578 else if (position === 'top-left') { 9579 mw.$(tooltip).css({ 9580 top: off.top - tipheight - arrheight, 9581 left: off.left 9582 }); 9583 } 9584 else if (position === 'top-center') { 9585 9586 mw.$(tooltip).css({ 9587 top: off.top - tipheight - arrheight, 9588 left: leftCenter 9589 }); 9590 } 9591 else if (position === 'left-top') { 9592 mw.$(tooltip).css({ 9593 top: off.top, 9594 left: off.left - tipwidth - arrheight 9595 }); 9596 } 9597 else if (position === 'left-bottom') { 9598 mw.$(tooltip).css({ 9599 top: (off.top + h) - tipheight, 9600 left: off.left - tipwidth - arrheight 9601 }); 9602 } 9603 else if (position === 'left-center') { 9604 mw.$(tooltip).css({ 9605 top: off.top - tipheight / 2 + h / 2, 9606 left: off.left - tipwidth - arrheight 9607 }); 9608 } 9609 else if (position === 'right-top') { 9610 mw.$(tooltip).css({ 9611 top: off.top, 9612 left: off.left + w 9613 }); 9614 } 9615 else if (position === 'right-bottom') { 9616 mw.$(tooltip).css({ 9617 top: (off.top + h) - tipheight, 9618 left: off.left + w 9619 }); 9620 } 9621 else if (position === 'right-center') { 9622 mw.$(tooltip).css({ 9623 top: off.top - tipheight / 2 + h / 2, 9624 left: off.left + w 9625 }); 9626 } 9627 if (parseFloat($(tooltip).css('top')) < 0) { 9628 mw.$(tooltip).css('top', 0); 9629 } 9630 this.show(); 9631 }; 9632 9633 var init = function () { 9634 create(); 9635 scope.position(); 9636 scope.show(); 9637 }; 9638 9639 init(); 9640 9641 }; 9642 9643 mw.ToolTip = ToolTip; 9644 9645 9646 var tooltip = { 9647 source: function (content, skin, position, id) { 9648 if (skin === 'dark') { 9649 skin = 'mw-tooltip-dark'; 9650 } else if (skin === 'warning') { 9651 skin = 'mw-tooltip-default mw-tooltip-warning'; 9652 } 9653 if (typeof id === 'undefined') {
9654 id = 'mw-tooltip-' + mw.random(); 9655 } 9656 var tooltip = document.createElement('div'); 9657 var tooltipc = document.createElement('div'); 9658 tooltip.className = 'mw-tooltip ' + position + ' ' + skin; 9659 tooltipc.className = 'mw-tooltip-content'; 9660 tooltip.id = id; 9661 $(tooltipc).append(content); 9662 $(tooltip).append(tooltipc).append('<span class="mw-tooltip-arrow"></span>'); 9663 document.body.appendChild(tooltip); 9664 return tooltip; 9665 }, 9666 setPosition: function (tooltip, el, position) { 9667 if(window.top.document.documentElement.dir === 'rtl') { 9668 if (position.indexOf('right') !== -1) { 9669 position = position.replace('right', 'left'); 9670 } else if (position.indexOf('left') !== -1) { 9671 position = position.replace('left', 'right'); 9672 } 9673 } 9674 el = mw.$(el); 9675 if (el.length === 0) { 9676 return false; 9677 } 9678 tooltip.tooltipData.element = el[0]; 9679 var w = el.outerWidth(), 9680 tipwidth = mw.$(tooltip).outerWidth(), 9681 h = el.outerHeight(), 9682 tipheight = mw.$(tooltip).outerHeight(), 9683 off = el.offset(), 9684 arrheight = mw.$('.mw-tooltip-arrow', tooltip).height(); 9685 if (off.top === 0 && off.left === 0) { 9686 off = mw.$(el).parent().offset(); 9687 } 9688 mw.tools.removeClass(tooltip, tooltip.tooltipData.position); 9689 mw.tools.addClass(tooltip, position); 9690 tooltip.tooltipData.position = position; 9691 9692 off.left = off.left > 0 ? off.left : 0; 9693 off.top = off.top > 0 ? off.top : 0; 9694 9695 var leftCenter = off.left - tipwidth / 2 + w / 2; 9696 leftCenter = leftCenter > 0 ? leftCenter : 0; 9697 9698 if (position === 'auto') { 9699 var $win = mw.$(window); 9700 var wxCenter = $win.width()/2; 9701 var wyCenter = ($win.height() + $win.scrollTop())/2; 9702 var elXCenter = off.left +(w/2); 9703 var elYCenter = off.top +(h/2); 9704 var xPos, yPost; 9705 var space = 100; 9706 9707 if(elXCenter > wxCenter) { 9708 xPos = 'left' 9709 } else { 9710 xPos = 'right' 9711 } 9712 9713 yPos = 'top' 9714 9715 9716 return this.setPosition (tooltip, el, (xPos+'-'+yPos)); 9717 } 9718 9719 if (position === 'bottom-left') { 9720 mw.$(tooltip).css({ 9721 top: off.top + h + arrheight, 9722 left: off.left 9723 }); 9724 } 9725 else if (position === 'bottom-center') { 9726 mw.$(tooltip).css({ 9727 top: off.top + h + arrheight, 9728 left: leftCenter 9729 }); 9730 } 9731 else if (position === 'bottom-right') { 9732 mw.$(tooltip).css({ 9733 top: off.top + h + arrheight, 9734 left: off.left - tipwidth + w 9735 }); 9736 } 9737 else if (position === 'top-right') { 9738 mw.$(tooltip).css({ 9739 top: off.top - tipheight - arrheight, 9740 left: off.left - tipwidth + w 9741 }); 9742 } 9743 else if (position === 'top-left') { 9744 mw.$(tooltip).css({ 9745 top: off.top - tipheight - arrheight, 9746 left: off.left 9747 }); 9748 } 9749 else if (position === 'top-center') { 9750 9751 mw.$(tooltip).css({ 9752 top: off.top - tipheight - arrheight, 9753 left: leftCenter 9754 }); 9755 } 9756 else if (position === 'left-top') { 9757 mw.$(tooltip).css({ 9758 top: off.top, 9759 left: off.left - tipwidth - arrheight 9760 }); 9761 } 9762 else if (position === 'left-bottom') { 9763 mw.$(tooltip).css({ 9764 top: (off.top + h) - tipheight, 9765 left: off.left - tipwidth - arrheight 9766 }); 9767 } 9768 else if (position === 'left-center') { 9769 mw.$(tooltip).css({ 9770 top: off.top - tipheight / 2 + h / 2, 9771 left: off.left - tipwidth - arrheight 9772 }); 9773 } 9774 else if (position === 'right-top') { 9775 mw.$(tooltip).css({ 9776 top: off.top, 9777 left: off.left + w + arrheight 9778 }); 9779 } 9780 else if (position === 'right-bottom') { 9781 mw.$(tooltip).css({ 9782 top: (off.top + h) - tipheight, 9783 left: off.left + w + arrheight 9784 }); 9785 } 9786 else if (position === 'right-center') { 9787 mw.$(tooltip).css({ 9788 top: off.top - tipheight / 2 + h / 2, 9789 left: off.left + w + arrheight 9790 }); 9791 } 9792 if (parseFloat($(tooltip).css('top')) < 0) { 9793 mw.$(tooltip).css('top', 0); 9794 } 9795 }, 9796 fixPosition: function (tooltip) { 9797 /* mw_todo */ 9798 var max = 5; 9799 var arr = mw.$('.mw-tooltip-arrow', tooltip); 9800 arr.css('left', ''); 9801 var arr_left = parseFloat(arr.css('left')); 9802 var tt = mw.$(tooltip); 9803 if (tt.length === 0) { 9804 return false;
9805 } 9806 var w = tt.width(), 9807 off = tt.offset(), 9808 ww = mw.$(window).width(); 9809 if ((off.left + w) > (ww - max)) { 9810 var diff = off.left - (ww - w - max); 9811 tt.css('left', ww - w - max); 9812 arr.css('left', arr_left + diff); 9813 } 9814 if (parseFloat(tt.css('top')) < 0) { 9815 tt.css('top', 0); 9816 } 9817 }, 9818 prepare: function (o) { 9819 if (typeof o.element === 'undefined') return false; 9820 if (o.element === null) return false; 9821 if (typeof o.element === 'string') { 9822 o.element = mw.$(o.element) 9823 } 9824 9825 if (o.element.constructor === [].constructor && o.element.length === 0) return false; 9826 if (typeof o.position === 'undefined') { 9827 o.position = 'auto'; 9828 } 9829 if (typeof o.skin === 'undefined') { 9830 o.skin = 'mw-tooltip-default'; 9831 } 9832 if (typeof o.id === 'undefined') { 9833 o.id = 'mw-tooltip-' + mw.random(); 9834 } 9835 if (typeof o.group === 'undefined') { 9836 o.group = null; 9837 } 9838 return { 9839 id: o.id, 9840 element: o.element, 9841 skin: o.template || o.skin, 9842 position: o.position, 9843 overlay: o.overlay, 9844 content: o.content, 9845 group: o.group 9846 } 9847 }, 9848 init: function (o, wl) { 9849 9850 var orig_options = o; 9851 o = mw.tools.tooltip.prepare(o); 9852 if (o === false) return false; 9853 var tip; 9854 if (o.id && mw.$('#' + o.id).length > 0) { 9855 tip = mw.$('#' + o.id)[0]; 9856 } else { 9857 tip = mw.tools.tooltip.source(o.content, o.skin, o.position, o.id); 9858 } 9859 9860 if(o.overlay) { 9861 var overlay = $('<div class="mw-tooltip-overlay"></div>'); 9862 tip.tremove = function () { 9863 overlay.remove(); 9864 tip.remove(); 9865 }; 9866 9867 overlay.on('click', function () { 9868 tip.tremove() 9869 }); 9870 9871 $('body').append(overlay) 9872 } 9873 tip.tooltipData = o; 9874 wl = wl || true; 9875 if (o.group) { 9876 var tip_group_class = 'mw-tooltip-group-' + o.group; 9877 var cur_tip = mw.$(tip) 9878 if (!cur_tip.hasClass(tip_group_class)) { 9879 cur_tip.addClass(tip_group_class); 9880 } 9881 var cur_tip_id = cur_tip.attr('id'); 9882 if (cur_tip_id) { 9883 mw.$("." + tip_group_class).not("#" + cur_tip_id).hide(); 9884 if (o.group && typeof orig_options.close_on_click_outside !== 'undefined' && orig_options.close_on_click_outside) { 9885 setTimeout(function () { 9886 mw.$("#" + cur_tip_id).show(); 9887 }, 100); 9888 } else { 9889 mw.$("#" + cur_tip_id).show(); 9890 } 9891 } 9892 } 9893 if (wl && $.contains(self.document, tip)) { 9894 9895 if (o.group && typeof orig_options.close_on_click_outside !== 'undefined' && orig_options.close_on_click_outside) { 9896 mw.$(self).bind('click', function (e, target) { 9897 mw.$("." + tip_group_class).hide(); 9898 }); 9899 } 9900 } 9901 mw.tools.tooltip.setPosition(tip, o.element, o.position); 9902 return tip; 9903 } 9904 9905 }; 9906 9907 mw.tools.tooltip = tooltip; 9908 var TTTime = null; 9909 mw.tools.titleTipOff = function () { 9910 9911 clearTimeout(TTTime); 9912 mw.$(mw.tools[ '_titleTip']).hide(); 9913 }; 9914 9915 mw.tools.titleTip = function (el, _titleTip) { 9916 clearTimeout(TTTime); 9917 mw.$(mw.tools[_titleTip]).hide(); 9918 TTTime = setTimeout(function (){ 9919 _titleTip = _titleTip || '_titleTip'; 9920 if (mw.tools.hasClass(el, 'tip-disabled')) { 9921 mw.$(mw.tools[_titleTip]).hide(); 9922 return false;
9923 } 9924 var skin = mw.$(el).attr('data-tipskin'); 9925 skin = (skin) ? skin : 'mw-tooltip-dark'; 9926 var pos = mw.$(el).attr('data-tipposition'); 9927 var iscircle = mw.$(el).attr('data-tipcircle') === 'true'; 9928 if (!pos) { 9929 pos = 'top-center'; 9930 } 9931 var text = mw.$(el).attr('data-tip'); 9932 if (!text) { 9933 text = mw.$(el).attr('title'); 9934 } 9935 if (!text) { 9936 text = mw.$(el).attr('tip'); 9937 } 9938 if (typeof text === 'undefined' || !text) { 9939 return; 9940 } 9941 if (text.indexOf('.') === 0 || text.indexOf('#') === 0) { 9942 var xitem = mw.$(text); 9943 if (xitem.length === 0) { 9944 return false; 9945 } 9946 text = xitem.html(); 9947 } 9948 else { 9949 text = text.replace(/\n/g, '<br>'); 9950 } 9951 var showon = mw.$(el).attr('data-showon'); 9952 if (showon) { 9953 el = mw.$(showon)[0]; 9954 } 9955 if (!mw.tools[_titleTip]) { 9956 mw.tools[_titleTip] = mw.tooltip({skin: skin, element: el, position: pos, content: text}); 9957 mw.$(mw.tools[_titleTip]).addClass('mw-universal-tooltip'); 9958 } 9959 else { 9960 mw.tools[_titleTip].className = 'mw-tooltip ' + pos + ' ' + skin + ' mw-universal-tooltip'; 9961 mw.$('.mw-tooltip-content', mw.tools[_titleTip]).html(text); 9962 mw.tools.tooltip.setPosition(mw.tools[_titleTip], el, pos); 9963 } 9964 if (iscircle) { 9965 mw.$(mw.tools[_titleTip]).addClass('mw-tooltip-circle'); 9966 } 9967 else { 9968 mw.$(mw.tools[_titleTip]).removeClass('mw-tooltip-circle'); 9969 } 9970 mw.$(mw.tools[_titleTip]).show(); 9971 }, 500); 9972 }; 9973 9974})(); 9975 9976 9977mw.required.push('https://www.shadowsgym.com.au/cms/userfiles/modules/microweber/api/tools/uiaccordion.js'); 9978 9979mw.uiAccordion = function (options) { 9980 if (!options) return; 9981 options.element = options.element || '.mw-accordion'; 9982 9983 var scope = this; 9984 9985 9986 9987 this.getContents = function () { 9988 this.contents = this.root.children(this.options.contentSelector); 9989 if (!this.contents.length) { 9990 this.contents = mw.$(); 9991 this.root.children(this.options.itemSelector).each(function () { 9992 var title = mw.$(this).children(scope.options.contentSelector)[0]; 9993 if (title) { 9994 scope.contents.push(title) 9995 } 9996 }); 9997 } 9998 } 9999 this.getTitles = function () { 10000 this.titles = this.root.children(this.options.titleSelector); 10001 if (!this.titles.length) { 10002 this.titles = mw.$(); 10003 this.root.children(this.options.itemSelector).each(function () { 10004 var title = mw.$(this).children(scope.options.titleSelector)[0]; 10005 if (title) { 10006 scope.titles.push(title) 10007 } 10008 }); 10009 } 10010 }; 10011 10012 this.prepare = function (options) { 10013 var defaults = { 10014 multiple: false, 10015 itemSelector: ".mw-accordion-item,mw-accordion-item", 10016 titleSelector: ".mw-accordion-title,mw-accordion-title", 10017 contentSelector: ".mw-accordion-content,mw-accordion-content", 10018 openFirst: true, 10019 toggle: true 10020 }; 10021 this.options = $.extend({}, defaults, options); 10022 10023 this.root = mw.$(this.options.element).not('.mw-accordion-ready').eq(0); 10024 if (!this.root.length) return; 10025 this.root.addClass('mw-accordion-ready'); 10026 this.root[0].uiAccordion = this; 10027 this.getTitles(); 10028 this.getContents(); 10029 10030 }; 10031 10032 this.getItem = function (q) { 10033 var item; 10034 if (typeof q === 'number') { 10035 item = this.contents.eq(q) 10036 } 10037 else { 10038 item = mw.$(q); 10039 } 10040 return item; 10041 }; 10042 10043 this.set = function (index) { 10044 var item = this.getItem(index); 10045 if (!this.options.multiple) { 10046 this.contents.not(item) 10047 .slideUp() 10048 .removeClass('active') 10049 .prev() 10050 .removeClass('active') 10051 .parents('.mw-accordion-item').eq(0) 10052 .removeClass('active'); 10053 } 10054 item.stop() 10055 .slideDown() 10056 .addClass('active') 10057 .prev() 10058 .addClass('active') 10059 .parents('.mw-accordion-item').eq(0) 10060 .addClass('active'); 10061 mw.$(this).trigger('accordionSet', [item]); 10062 }; 10063 10064 this.unset = function (index) { 10065 if (typeof index === 'undefined') return; 10066 var item = this.getItem(index); 10067 item.stop() 10068 .slideUp() 10069 .removeClass('active') 10070 .prev() 10071 .removeClass('active') 10072 .parents('.mw-accordion-item').eq(0) 10073 .removeClass('active'); 10074 10075 mw.$(this).trigger('accordionUnset', [item]); 10076 } 10077 10078 this.toggle = function (index) { 10079 var item = this.getItem(index); 10080 if (item.hasClass('active')) { 10081 if (this.options.toggle) { 10082 this.unset(item) 10083 } 10084 } 10085 else { 10086 this.set(item) 10087 } 10088 } 10089 10090 this.init = function (options) { 10091 this.prepare(options); 10092 if(typeof(this.contents) !== 'undefined'){ 10093 this.contents.hide() 10094 } 10095 10096 if (this.options.openFirst) { 10097 if(typeof(this.contents) !== 'undefined'){ 10098 this.contents.eq(0).show().addClass('active') 10099 } 10100 if(typeof(this.titles) !== 'undefined'){ 10101 this.titles.eq(0).addClass('active').parent('.mw-accordion-item').addClass('active'); 10102 } 10103 } 10104 if(typeof(this.titles) !== 'undefined') { 10105 this.titles.on('click', function () { 10106 scope.toggle(scope.titles.index(this)); 10107 }); 10108 } 10109 } 10110 10111 this.init(options); 10112 10113}; 10114 10115 10116mw.tabAccordion = function (options, accordion) { 10117 if (!options) return; 10118 var scope = this; 10119 this.options = options; 10120 10121 this.options.breakPoint = this.options.breakPoint || 800; 10122 this.options.activeClass = this.options.activeClass || 'active'; 10123 10124 10125 this.buildAccordion = function () { 10126 this.accordion = accordion || new mw.uiAccordion(this.options); 10127 } 10128 10129 this.breakPoint = function () { 10130 if (matchMedia("(max-width: " + this.options.breakPoint + "px)").matches) { 10131 mw.$(this.nav).hide(); 10132 mw.$(this.accordion.titles).show(); 10133 } 10134 else { 10135 mw.$(this.nav).show(); 10136 mw.$(this.accordion.titles).hide(); 10137 } 10138 } 10139 10140 this.createTabButton = function (content, index) { 10141 this.buttons = this.buttons || mw.$(); 10142 var btn = document.createElement('span'); 10143 this.buttons.push(btn) 10144 var size = (this.options.tabsSize ? ' mw-ui-btn-' + this.options.tabsSize : ''); 10145 var color = (this.options.tabsColor ? ' mw-ui-btn-' + this.options.tabsColor : ''); 10146 var active = (index === 0 ? (' ' + this.options.activeClass) : ''); 10147 btn.className = (active + ' btn btn-link mw-admin-action-links mw-adm-liveedit-tabs mx-1'); 10148 btn.innerHTML = content; 10149 btn.onclick = function () { 10150 scope.buttons.removeClass(scope.options.activeClass).eq(index).addClass(scope.options.activeClass); 10151 scope.accordion.set(index); 10152 } 10153 return btn; 10154 } 10155 10156 this.createTabs = function () { 10157 this.nav = document.createElement('div'); 10158 this.nav.className = 'mx-3'; 10159 mw.$(this.accordion.titles) 10160 .each(function (i) { 10161 scope.nav.appendChild(scope.createTabButton($(this).html(), i)) 10162 }) 10163 .hide(); 10164 mw.$(this.accordion.root).before(this.nav) 10165 } 10166 10167 this.init = function () { 10168 this.buildAccordion(); 10169 this.createTabs(); 10170 this.breakPoint(); 10171 mw.$(window).on('load resize orientationchange', function () { 10172 scope.breakPoint(); 10173 }); 10174 }; 10175 10176 this.init(); 10177}; 10178 10179 10180 10181 10182mw.require('components.js'); 10183 10184mw.confirm = mw.tools.confirm; 10185mw.prompt = mw.tools.prompt; 10186mw.tabs = mw.tools.tabGroup; 10187mw.progress = mw.tools.progress; 10188mw.external = function (o) { 10189 return mw.tools._external(o); 10190}; 10191 10192mw.gallery = function (arr, start, modal) { 10193 10194 return mw.tools.gallery.init(arr, start, modal) 10195 10196}; 10197 10198mw.alert = mw.tools.alert; 10199mw.tooltip = function (config) { 10200 return mw.tools.tooltip.init(config); 10201}; 10202 10203mw.gallery = function (arr, start, modal) { 10204 return mw.tools.gallery.init(arr, start, modal) 10205}; 10206 10207 10208 10209mw.cookie = { 10210 get: function (name) { 10211 var cookies = document.cookie.split(";"), i = 0, l = cookies.length; 10212 for (; i < l; i++) { 10213 var x = cookies[i].substr(0, cookies[i].indexOf("=")); 10214 var y = cookies[i].substr(cookies[i].indexOf("=") + 1); 10215 x = x.replace(/^\s+|\s+$/g, ""); 10216 if (x === name) { 10217 return unescape(y); 10218 } 10219 } 10220 }, 10221 delete: function (name) { 10222 document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 10223 }, 10224 set: function (name, value, expires, path, domain, secure) { 10225 var now = new Date(); 10226 expires = expires || 365; 10227 now.setTime(now.getTime()); 10228 if (expires) { 10229 expires = expires * 1000 * 60 * 60 * 24; 10230 } 10231 var expires_date = new Date(now.getTime() + (expires)); 10232 document.cookie = name + "=" + escape(value) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : ";path=/" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); 10233 }, 10234 setEncoded: function (name, value, expires, path, domain, secure) { 10235 // value = encodeURIComponent(value); 10236 // value = escape(value); 10237 // value = mw.tools.base64.encode( unescape( encodeURIComponent( value ) ) ) 10238 value = mw.tools.base64.encode(value); 10239 return this.set(name, value, expires, path, domain, secure); 10240 }, 10241 getEncoded: function (name) { 10242 var value = this.get(name); 10243 // value = decodeURIComponent(value); 10244 // value = unescape(value); 10245 // value = decodeURIComponent( escape( mw.tools.base64.decode( value ) ) ) 10246 value = mw.tools.base64.decode(value); 10247 return value; 10248 }, 10249 ui: function (a, b) {
10250 var mwui = mw.cookie.getEncoded("mwui"); 10251 try { 10252 mwui = (!mwui || mwui === '') ? {} : $.parseJSON(mwui); 10253 } 10254 catch (e) { 10255 return false; 10256 } 10257 if (typeof a === 'undefined') { 10258 return mwui; 10259 } 10260 if (typeof b === 'undefined') { 10261 return mwui[a] !== undefined ? mwui[a] : ""; 10262 } 10263 else { 10264 mwui[a] = b; 10265 var tostring = JSON.stringify(mwui); 10266 mw.cookie.setEncoded("mwui", tostring, false, "/"); 10267 if (typeof mw.cookie.uievents[a] !== 'undefined') { 10268 var funcs = mw.cookie.uievents[a], l = funcs.length, i = 0; 10269 for (; i < l; i++) { 10270 mw.cookie.uievents[a][i].call(b.toString()); 10271 } 10272 } 10273 } 10274 }, 10275 uievents: {}, 10276 changeInterval: null, 10277 uiCurr: null, 10278 onchange: function (name, func) { 10279 if (typeof mw.cookie.uievents[name] === 'undefined') { 10280 mw.cookie.uievents[name] = [func]; 10281 } 10282 else { 10283 mw.cookie.uievents[name].push(func); 10284 } 10285 } 10286}; 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298var getFieldValue = function(a){ 10299 return typeof a === 'string' ? a : ( typeof a === 'object' && a.tagName !== undefined ? a.value : null); 10300}; 10301 10302 10303//Cross-browser placeholder 10304 10305 10306mw.Form = function(options) { 10307 options = options || {}; 10308 var defaults = { 10309 form: null 10310 }; 10311 this.settings = $.extend({}, defaults, options); 10312 10313 this.$form = mw.$(this.settings.form).eq(0); 10314 this.form = this.$form[0]; 10315 if (!this.form) { 10316 return; 10317 } 10318 10319 this.addBeforePost = function (func, cb) { 10320 10321 }; 10322}; 10323 10324 10325 10326var setValidity = function (state, obj) { 10327 var $el = mw.element(obj); 10328 if(state){ 10329 $el.parents('.field').removeClass("error"); 10330 $el.parent().find('.mw-error').remove(); 10331 } 10332 else{ 10333 $el.parents('.field').addClass("error"); 10334 10335 } 10336}; 10337 10338 10339mw.form = { 10340 typeNumber:function(el){ 10341 el.value = el.value.replace(/[^0-9\.,]/g,''); 10342 }, 10343 fixPrice:function(el){ 10344 el.value = el.value.replace(/,/g,''); 10345 var arr = el.value.split('.'); 10346 var len = arr.length; 10347 if(len>1){ 10348 if(arr[len-1]===''){ 10349 arr[len-1] = '.00'; 10350 } 10351 else{ 10352 arr[len-1] = '.' + arr[len-1]; 10353 } 10354 el.value = arr.join(''); 10355 } 10356 }, 10357 dstatic:function(event, d){ 10358 10359 }, 10360 post: function(selector, url_to_post, callback, ignorenopost, callback_error, callback_user_cancel, before_send){ 10361 mw.session.checkPause = true; 10362 if(selector.constructor === {}.constructor){ 10363 return mw.form._post(selector); 10364 } 10365 10366 callback_error = callback_error || false; 10367 ignorenopost = ignorenopost || false; 10368 var is_form_valid = mw.form.validate.init(selector); 10369 10370 if(!url_to_post){ 10371 10372 url_to_post = mw.settings.site_url + 'api/post_form'; 10373 10374 } 10375 10376 10377 if(is_form_valid){ 10378 10379 var form = mw.$(selector)[0]; 10380 if (form._isSubmitting) { 10381 return; 10382 } 10383 10384 form._isSubmitting = true; 10385 10386 var when = form.$beforepost ? form.$beforepost : function () {}; 10387 $.when(when()).then(function() { 10388 setTimeout(function () { 10389 var obj = mw.form.serialize(selector, ignorenopost); 10390 10391 10392 10393 10394 var req = { 10395 url: url_to_post, 10396 data: before_send ? before_send(obj) : obj, 10397 method: 'post', 10398 dataType: "json", 10399 statusCode: { 10400 201: function(data){ 10401 // copy of success 10402 mw.session.checkPause = false; 10403 if(typeof callback === 'function'){ 10404 callback.call(data, mw.$(selector)[0]); 10405 } else { 10406 return data; 10407 } 10408 } 10409 }, 10410 success: function(data){ 10411/* 10412 if(typeof (data.error) != 'undefined' && data.error){ 10413 mw.notification.error(data.error); 10414 }*/ 10415 10416 mw.session.checkPause = false;
10417 if(typeof callback === 'function'){ 10418 callback.call(data, mw.$(selector)[0]); 10419 } else { 10420 return data; 10421 } 10422 }, 10423 10424 onExternalDataDialogClose: function() { 10425 if(callback_user_cancel) { 10426 callback_user_cancel.call(); 10427 } 10428 } 10429 } 10430 10431 if (form.getAttribute('enctype') === "multipart/form-data") { 10432 10433 var form_data = new FormData(); 10434 $.each(req.data, function (k,v) { 10435 form_data.append(k,v); 10436 }); 10437 10438 $('[type="file"]', form).each(function () { 10439 if(typeof this.files[0] !== 'undefined') { 10440 form_data.set(this.name, this.files[0]); 10441 } 10442 }); 10443 10444 req.data = form_data; 10445 req.processData = false; 10446 req.contentType = false;
10447 req.mimeType = 'multipart/form-data'; 10448 } 10449 10450 var xhr = $.ajax(req); 10451 xhr.always(function(jqXHR, textStatus) { 10452 form._isSubmitting = false; 10453 }); 10454 xhr.fail(function(a,b) { 10455 mw.session.checkPause = false; 10456 if(typeof callback_error === 'function'){ 10457 callback_error.call(a,b); 10458 } 10459 }); 10460 }, 78); 10461 }); 10462 10463 10464 } 10465 return false; 10466 }, 10467 _post:function(obj){ 10468 mw.form.post(obj.selector, obj.url, obj.done, obj.ignorenopost, obj.error, obj.error); 10469 }, 10470 validate:{ 10471 checkbox: function(obj){ 10472 return obj.checked === true; 10473 }, 10474 field:function(obj){ 10475 return !!getFieldValue(obj).trim(); 10476 }, 10477 email:function(obj){ 10478 var regexmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+$/; 10479 return regexmail.test(getFieldValue(obj)); 10480 }, 10481 url:function(obj){ 10482 /* var rurl =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; */ 10483 var rurl = /^((https?|ftp):\/\/)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/; 10484 return rurl.test(getFieldValue(getFieldValue(obj))); 10485 }, 10486 radio:function(objname){ 10487 var radios = document.getElementsByName(objname), i = 0, len = radios.length; 10488 this_radio_valid = false; 10489 for( ; i < len ; i++){ 10490 if(radios[i].checked){ 10491 this_radio_valid = true; 10492 break; 10493 } 10494 } 10495 var parent = mw.$(document.getElementsByName(objname)[0].parentNode); 10496 if(this_radio_valid){ 10497 parent.removeClass("error"); 10498 } 10499 else{ 10500 parent.addClass("error"); 10501 } 10502 return this_radio_valid; 10503 }, 10504 image_url:function(url, valid, invalid){ 10505 url = url.replace(/\s/gi,''); 10506 if(url.length<6){ 10507 typeof invalid === 'function'? invalid.call(url) : ''; 10508 return false; 10509 } 10510 else{ 10511 if(!url.contains('http')){url = 'http://'+url} 10512 if(!window.ImgTester){ 10513 window.ImgTester = new Image(); 10514 document.body.appendChild(window.ImgTester); 10515 window.ImgTester.className = 'semi_hidden'; 10516 window.ImgTester.onload = function(){ 10517 typeof valid === 'function'? valid.call(url) : ''; 10518 } 10519 window.ImgTester.onerror = function(){ 10520 typeof invalid === 'function'? invalid.call(url) : ''; 10521 } 10522 } 10523 window.ImgTester.src = url; 10524 } 10525 }, 10526 proceed:{ 10527 checkbox:function(obj){ 10528 setValidity(mw.form.validate.checkbox(obj), obj) 10529 }, 10530 field:function(obj){ 10531 setValidity(mw.form.validate.field(obj), obj) 10532 10533 }, 10534 email:function(obj){ 10535 setValidity(mw.form.validate.email(obj), obj) 10536 } 10537 }, 10538 checkFields:function(form){ 10539 mw.$(form).find(".required,[required]").each(function(){ 10540 var type = mw.$(this).attr("type"); 10541 if(type==='checkbox'){ 10542 mw.form.validate.proceed.checkbox(this); 10543 } 10544 else if(type==='radio'){ 10545 mw.form.validate.radio(this.name); 10546 } 10547 else{ 10548 mw.form.validate.proceed.field(this); 10549 } 10550 }); 10551 mw.$(form).find(".required-email").each(function(){ 10552 mw.form.validate.proceed.email(this); 10553 }); 10554 }, 10555 init:function(obj){ 10556 mw.form.validate.checkFields(obj); 10557 if($(obj).find(".error").length>0){ 10558 mw.$(obj).addClass("error submited"); 10559 return false;
10560 } 10561 else{ 10562 mw.$(obj).removeClass("error"); 10563 return true; 10564 } 10565 } 10566 }, 10567 serialize : function(id, ignorenopost){ 10568 var ignorenopost = ignorenopost || false; 10569 return mw.serializeFields(id, ignorenopost); 10570 }, 10571 unsavedChangesCheck: function(elementId) { 10572 var form = document.getElementById(elementId); 10573 if (form) { 10574 form.onsubmit = function () { 10575 document.body.classList.remove('mw-unsaved-changes'); 10576 }; 10577 var formInputs = form.querySelectorAll('input'); 10578 if (formInputs) { 10579 for (var i = 0; i < formInputs.length; i++) { 10580 formInputs[i].addEventListener('change', function () { 10581 document.body.classList.add('mw-unsaved-changes'); 10582 }); 10583 } 10584 } 10585 } 10586 } 10587} 10588 10589 10590mw.postForm = function(o){ 10591 return mw.form._post(o); 10592} 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608// URL Strings - Manipulations 10609 10610json2url = function(obj){ var t=[];for(var x in obj)t.push(x+"="+encodeURIComponent(obj[x]));return t.join("&").replace(/undefined/g, 'false') }; 10611 10612 10613mw.url = { 10614 hashStart: '', 10615 getDomain:function(url){ 10616 return url.match(/:\/\/(www\.)?(.[^/:]+)/)[2]; 10617 }, 10618 removeHash:function(url){ 10619 return url.replace( /#.*/, ""); 10620 }, 10621 getHash:function(url){ 10622 return url.indexOf('#')!=-1 ? url.substring(url.indexOf('#'), url.length) : ""; 10623 }, 10624 strip:function(url){ 10625 return url.replace(/#[^#]*$/, "").replace(/\?[^\?]*$/, "") 10626 }, 10627 getUrlParams:function(url){ 10628 url = mw.url.removeHash(url); 10629 if(url.contains('?')){ 10630 var arr = url.slice(url.indexOf('?') + 1).split('&'); 10631 var obj = {}, i=0, len = arr.length; 10632 for( ; i<len; i++){ 10633 var p_arr = arr[i].split('='); 10634 obj[p_arr[0]] = p_arr[1]; 10635 } 10636 return obj; 10637 } 10638 else{return {} } 10639 }, 10640 set_param:function(param, value, url){ 10641 url = url || window.location.href; 10642 var hash = mw.url.getHash(url); 10643 var params = mw.url.getUrlParams(url); 10644 params[param] = value; 10645 var params_string = json2url(params); 10646 var url = mw.url.strip(url); 10647 return decodeURIComponent (url + "?" + params_string + hash); 10648 }, 10649 remove_param:function(url, param){ 10650 var hash = mw.url.getHash(url); 10651 var params = mw.url.getUrlParams(url); 10652 delete params[param]; 10653 var params_string = json2url(params); 10654 url = mw.url.strip(url); 10655 return decodeURIComponent (url + "?" + params_string + hash); 10656 }, 10657 getHashParams:function(hash){ 10658 var r = new RegExp(mw.url.hashStart, "g"); 10659 var hash = hash.replace(r, ""); 10660 var hash = hash.replace(/\?/g, ""); 10661 if(hash=='' || hash=='#'){ 10662 return {} 10663 } 10664 else{ 10665 var hash = hash.replace(/#/g, ""); 10666 var arr = hash.split('&'); 10667 var obj = {}, i=0, len = arr.length; 10668 for( ; i<len; i++){ 10669 var p_arr = arr[i].split('='); 10670 obj[p_arr[0]] = p_arr[1]; 10671 } 10672 return obj; 10673 } 10674 }, 10675 setHashParam:function(param, value, hash){ 10676 10677 var hash = hash || mw.hash(); 10678 var obj = mw.url.getHashParams(hash); 10679 obj[param] = value; 10680 return mw.url.hashStart + decodeURIComponent(json2url(obj)); 10681 }, 10682 windowHashParam:function(a,b){ 10683 if(b !== undefined){ 10684 mw.hash(mw.url.setHashParam(a,b)); 10685 } 10686 else{ 10687 return mw.url.getHashParams(mw.hash())[a]; 10688 } 10689 }, 10690 deleteHashParam:function(hash, param){ 10691 var params = mw.url.getHashParams(hash); 10692 delete params[param]; 10693 var params_string = decodeURIComponent(mw.url.hashStart+json2url(params)); 10694 return params_string; 10695 }, 10696 windowDeleteHashParam:function(param){ 10697 mw.hash(mw.url.deleteHashParam(window.location.hash, param)); 10698 }, 10699 whichHashParamsHasBeenRemoved:function(currHash, prevHash){ 10700 var curr = mw.url.getHashParams(currHash); 10701 var prev = mw.url.getHashParams(prevHash); 10702 var hashes = []; 10703 for(var x in prev){ 10704 curr[x] === undefined ? hashes.push(x) : ''; 10705 } 10706 return hashes; 10707 }, 10708 hashParamToActiveNode:function(param, classNamespace, context){ 10709 var context = context || document.body; 10710 var val = mw.url.windowHashParam(param); 10711 mw.$('.'+classNamespace, context).removeClass('active'); 10712 var active = mw.$('.'+classNamespace + '-' + val, context); 10713 if(active.length > 0){ 10714 active.addClass('active'); 10715 } 10716 else{ 10717 mw.$('.'+classNamespace + '-none', context).addClass('active'); 10718 } 10719 }, 10720 mwParams:function(url){ 10721 url = url || window.location.pathname; 10722 url = mw.url.removeHash(url); 10723 var arr = url.split('/'); 10724 var obj = {}; 10725 var i=0,l=arr.length; 10726 for( ; i<l; i++){ 10727 if(arr[i].indexOf(':') !== -1 && arr[i].indexOf('http') === -1){ 10728 var p = arr[i].split(':'); 10729 obj[p[0]] = p[1]; 10730 } 10731 } 10732 return obj; 10733 }, 10734 type:function(url){ 10735 if(!url) return; 10736 url = url.toString(); 10737 if( url === 'false' ){ 10738 return false;
10739 } 10740 if(url.indexOf('/images.unsplash.com/') !== -1){ 10741 return 'image'; 10742 } 10743 var extension = url.split('.').pop(); 10744 var images = 'jpg,png,gif,jpeg,bmp'; 10745 if(images.contains(extension)){ 10746 return 'image'; 10747 } 10748 else if(extension=='swf'){return 'flash'} 10749 else if(extension=='pdf'){return 'pdf'} 10750 else if(url.contains('youtube.com') || url.contains('youtu.be')){return 'youtube'} 10751 else if(url.contains('vimeo.com')){return 'vimeo'} 10752 10753 else{ return 'link'; } 10754 } 10755}; 10756 10757mw.slug = { 10758 max: 2048, 10759 normalize:function(string){ 10760 if(!string) return ''; 10761 string = string.substring(0, mw.slug.max); 10762 return string.replace(/[`\/~!@#$%^&№€§*()\=?'"<>\{\}\[\]\\]/g, ''); 10763 }, 10764 removeSpecials:function(string){ 10765 string = mw.slug.normalize(string); 10766 if(!string) return string; 10767 var special = 'àáäãâèéëêìÃÂïîòóöôõùúüûñç·=,:;', 10768 normal = 'aaaaaeeeeiiiiooooouuuunc------', 10769 len = special.length, 10770 i = 0; 10771 for ( ; i<len; i++) { 10772 var bad = special[i]; 10773 var good = normal[i]; 10774 string = string.replace(new RegExp(bad, 'g'), good); 10775 } 10776 return string; 10777 }, 10778 create:function(string){ 10779 string = string || ''; 10780 string = mw.slug.removeSpecials(string); 10781 return string.trim().toLowerCase().replace(/[-\s]+/g, '-'); 10782 } 10783}; 10784 10785 10786mw.require('url.js'); 10787 10788mw.hash = function(b){ return b === undefined ? window.location.hash : window.location.hash = b; }; 10789 10790mw.on = function(eventName, callback){ 10791 eventName = eventName.trim() 10792 $.each(eventName.split(' '), function(){ 10793 mw.$(mw._on._eventsRegister).on(this.toString(), callback); 10794 }); 10795}; 10796mw.trigger = function(eventName, paramsArray){ 10797 return mw.$([mww, mw._on._eventsRegister]).trigger(eventName, paramsArray); 10798}; 10799 10800mw._on = { 10801 _eventsRegister:{}, 10802 mouseDownAndUp:function(el, callback){ 10803 var $el = mw.$(el); 10804 el = $el[0]; 10805 $el.on('mousedown touchstart', function(){ 10806 this.__downTime = new Date().getTime(); 10807 (function(el){ 10808 setTimeout(function(){ 10809 el.__downTime = -1; 10810 }, 777); 10811 })(this); 10812 }); 10813 $el.on('mouseup touchend', function(e){ 10814 if(!!callback){ 10815 callback.call(this, new Date().getTime()-this.__downTime, e) 10816 } 10817 }); 10818 }, 10819 onmodules : {}, 10820 moduleReload : function(id, c, trigger){ 10821 var exists; 10822 if(trigger){ 10823 exists = typeof mw.on.onmodules[id] !== 'undefined'; 10824 if(exists){ 10825 var i = 0, l = mw.on.onmodules[id].length; 10826 for( ; i < l; i++){ 10827 mw.on.onmodules[id][i].call(document.getElementById(id)); 10828 } 10829 } 10830 return false; 10831 } 10832 if(mw.is.func(c)){ 10833 exists = typeof mw.on.onmodules[id] !== 'undefined'; 10834 if(exists){ 10835 mw.on.onmodules[id].push(c); 10836 } 10837 else{ 10838 mw.on.onmodules[id] = [c]; 10839 } 10840 } 10841 else if(c==='off'){ 10842 exists = typeof mw.on.onmodules[id] !== 'undefined'; 10843 if(exists){ 10844 mw.on.onmodules[id] = []; 10845 } 10846 } 10847 }, 10848 _hashrec : {}, 10849 _hashparams : this._hashparams || [], 10850 _hashparam_funcs : [], 10851 hashParam : function(param, callback, trigger, isManual){ 10852 var index; 10853 if(isManual){ 10854 index = mw.on._hashparams.indexOf(param); 10855 if (mw.on._hashparam_funcs[index] !== undefined){ 10856 mw.on._hashparam_funcs[index].call(false, false); 10857 } 10858 return false; 10859 } 10860 if(trigger === true){ 10861 index = mw.on._hashparams.indexOf(param); 10862 10863 if(index !== -1){ 10864 var hash = mw.hash(); 10865 var params = mw.url.getHashParams(hash); 10866 10867 if (typeof params[param] === 'string' && mw.on._hashparam_funcs[index] !== undefined) { 10868 var pval = decodeURIComponent(params[param]); 10869 mw.on._hashparam_funcs[index].call(pval, pval); 10870 10871 } 10872 } 10873 } 10874 else{ 10875 mw.on._hashparams.push(param); 10876 mw.on._hashparam_funcs.push(callback); 10877 } 10878}, 10879hashParamEventInit:function(){ 10880 var hash = mw.hash(); 10881 var params = mw.url.getHashParams(hash); 10882 10883 if(hash==='' || hash==='#' || hash ==='#?'){ 10884 var len = mw.on._hashparams.length, i=0; 10885 for( ; i < len; i++){ 10886 mw.on.hashParam(mw.on._hashparams[i], "", true); 10887 } 10888 } 10889 else{ 10890 for(var x in params){ 10891 if(params[x] !== mw.on._hashrec[x] || typeof mw.on._hashrec[x] === 'undefined'){ 10892 mw.on.hashParam(x, "", true); 10893 } 10894 } 10895 } 10896 10897 mw.on._hashrec = params; 10898}, 10899DOMChangePause:false, 10900DOMChangeTime:1500, 10901DOMChange:function(element, callback, attr, a){ 10902 attr = attr || false; 10903 a = a || false; 10904 10905 element.addEventListener("input", function(e){ 10906 if( !mw.on.DOMChangePause ) { 10907 if(!a){ 10908 callback.call(this); 10909 } 10910 else{ 10911 clearTimeout(element._int); 10912 element._int = setTimeout(function(){ 10913 callback.call(element); 10914 }, mw.on.DOMChangeTime); 10915 } 10916 10917 } 10918 }, false); 10919 10920 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 10921 10922 if(typeof MutationObserver === 'function'){ 10923 var observer = new MutationObserver(function(mutations) { 10924 mutations.forEach(function(mutation){ 10925 if( !mw.on.DOMChangePause ) { 10926 callback.call(mutation.target); 10927 } 10928 }); 10929 }); 10930 var config = { attributes: attr, childList: true, characterData: true }; 10931 observer.observe(element, config); 10932 } else { 10933 element.addEventListener("DOMCharacterDataModified", function(e){ 10934 if( !mw.on.DOMChangePause ) { 10935 if(!a){ 10936 callback.call(this); 10937 } 10938 else{ 10939 clearTimeout(element._int); 10940 element._int = setTimeout(function(){ 10941 callback.call(element); 10942 }, mw.on.DOMChangeTime); 10943 } 10944 10945 } 10946 }, false); 10947 element.addEventListener("DOMNodeInserted", function(e){ 10948 10949 if(/*mw.tools.hasClass(e.target, 'element') || */mw.tools.hasClass(e.target, 'module') || mw.tools.hasParentsWithClass(e.target, 'module')){ 10950 return false;
10951 } 10952 if( !mw.on.DOMChangePause ) { 10953 if(!a){ 10954 callback.call(this); 10955 } 10956 else{ 10957 clearTimeout(element._int); 10958 element._int = setTimeout(function(){ 10959 callback.call(element); 10960 }, mw.on.DOMChangeTime); 10961 } 10962 } 10963 }, false); 10964 10965 if(attr){ 10966 element.addEventListener("DOMAttrModified", function(e){ 10967 10968 var attr = e.attrName; 10969 if(attr !== "contenteditable"){ 10970 if( !mw.on.DOMChangePause ) { 10971 if(!a){ 10972 callback.call(this); 10973 } 10974 else{ 10975 clearTimeout(element._int); 10976 element._int = setTimeout(function(){ 10977 callback.call(element); 10978 }, mw.on.DOMChangeTime); 10979 } 10980 } 10981 } 10982 }, false); 10983 } 10984 } 10985 10986 }, 10987 stopWriting:function(el, c){ 10988 if(el === null || typeof el === 'undefined'){ return false; } 10989 if(!el.onstopWriting){ 10990 el.onstopWriting = null; 10991 } 10992 clearTimeout(el.onstopWriting); 10993 el.onstopWriting = setTimeout(function(){ 10994 c.call(el); 10995 }, 400); 10996 }, 10997 scrollBarOnBottom : function(obj, distance, callback){ 10998 if(typeof obj === 'function'){ 10999 callback = obj; 11000 obj = window; 11001 distance = 0; 11002 } 11003 if(typeof distance === 'function'){ 11004 callback = distance; 11005 distance = 0; 11006 } 11007 obj._pauseCallback = false; 11008 obj.pauseScrollCallback = function(){ obj._pauseCallback = true;} 11009 obj.continueScrollCallback = function(){ obj._pauseCallback = false;} 11010 mw.$(obj).scroll(function(e){ 11011 var h = obj === window ? document.body.scrollHeight : obj.scrollHeight; 11012 var calc = h - mw.$(obj).scrollTop() - mw.$(obj).height(); 11013 if(calc <= distance && !obj._pauseCallback){ 11014 callback.call(obj); 11015 } 11016 }); 11017 }, 11018 tripleClick : function(el, callback){ 11019 var t, timeout = 199; 11020 el = el || window; 11021 el.addEventListener("dblclick", function () { 11022 t = setTimeout(function () { 11023 t = null; 11024 }, timeout); 11025 }); 11026 el.addEventListener("click", function (e) { 11027 if (t) { 11028 clearTimeout(t); 11029 t = null; 11030 callback.call(el, e.target); 11031 } 11032 }); 11033 }, 11034 transitionEnd:function(el,callback){ 11035 mw.$(el).bind('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd otransitionend', function(){ 11036 callback.call(el); 11037 }); 11038 }, 11039 ones:{ }, 11040 one:function(name, c, trigger, isDone){ 11041 if(trigger !== true){ 11042 if(mw.on.ones[name] === undefined){ 11043 mw.on.ones[name] = [c] 11044 } 11045 else{ 11046 mw.on.ones[name].push(c); 11047 } 11048 } 11049 else{ 11050 if(mw.on.ones[name] !== undefined){ 11051 var i=0, l = mw.on.ones[name].length; 11052 for( ; i<l; i++){ 11053 if(isDone === true){ 11054 mw.on.ones[name][i].call('ready', 'ready'); 11055 } 11056 else{ 11057 mw.on.ones[name][i].call('start', 'start'); 11058 } 11059 } 11060 } 11061 } 11062 }, 11063 userIteractionInitRegister: new Date().getTime(), 11064 userIteractionInit: function(){ 11065 var max = 378; 11066 mw.$(mwd).on('mousemove touchstart click keydown resize ajaxStop', function(){ 11067 var time = new Date().getTime(); 11068 if((time - mw._on.userIteractionInitRegister) > max){ 11069 mw._on.userIteractionInitRegister = time; 11070 mw.trigger('UserInteraction'); 11071 } 11072 }); 11073 } 11074}; 11075 11076for(var x in mw._on) mw.on[x] = mw._on[x]; 11077 11078 11079 11080mw.hashHistory = [window.location.hash] 11081 11082mw.prevHash = function(){ 11083 var prev = mw.hashHistory[mw.hashHistory.length - 2]; 11084 return prev !== undefined ? prev : ''; 11085}; 11086 11087 11088 11089$(window).on("hashchange load", function(event){ 11090 if(event.type === 'load'){ 11091 mw._on.userIteractionInit(); 11092 } 11093 11094 mw.on.hashParamEventInit(); 11095 11096 var hash = mw.hash(); 11097 11098 var isMWHash = hash.replace(/\#/g, '').indexOf('mw@') === 0; 11099 if (isMWHash) { 11100 var MWHash = hash.replace(/\#/g, '').replace('mw@', ''); 11101 var el = document.getElementById(MWHash); 11102 if(el) { 11103 mw.tools.scrollTo(el); 11104 } 11105 } 11106 if(hash.contains("showpostscat")){ 11107 mw.$("html").addClass("showpostscat"); 11108 } 11109 else{ 11110 mw.$("html").removeClass("showpostscat"); 11111 } 11112 11113
11114 if (event.type === 'hashchange') { 11115 mw.hashHistory.push(mw.hash()); 11116 var size = mw.hashHistory.length; 11117 var changes = mw.url.whichHashParamsHasBeenRemoved(mw.hashHistory[size-1], mw.hashHistory[size-2]), l=changes.length, i=0; 11118 if (l>0) { 11119 for( ; i < l; i++ ){ 11120 mw.on.hashParam(changes[i], "", true, true); 11121 } 11122 } 11123 } 11124}); 11125 11126 11127mw.event = { 11128 windowLeave: function(c) { 11129 document.documentElement.addEventListener('mouseout', function(e) { 11130 if (!e.relatedTarget && !e.toElement && c) { 11131 c.call(document.body, e); 11132 } 11133 }); 11134 }, 11135 cancel:function(e, prevent){ 11136 prevent === true ? e.preventDefault() : ''; 11137 e.cancelBubble = true; 11138 if (e.stopPropagation) e.stopPropagation(); 11139 }, 11140 key:function(e,key){ 11141 return (e.keyCode === parseFloat(key)); 11142 }, 11143 page: function (e) { 11144 e = e.originalEvent || e; 11145 if (e.type.indexOf('touch') !== 0) { 11146 return { 11147 x: e.pageX, 11148 y: e.pageY 11149 }; 11150 } else { 11151 return { 11152 x: e.changedTouches[0].pageX, 11153 y: e.changedTouches[0].pageY 11154 }; 11155 } 11156 }, 11157 targetIsField: function(e) { 11158 e = e.originalEvent || e; 11159 var t = e.target; 11160 return t.nodeName === 'INPUT' || 11161 t.nodeName === 'textarea' || 11162 t.nodeName === 'select'; 11163 }, 11164 get: function(e) { 11165 return e.originalEvent || e; 11166 }, 11167 keyCode: function(e) { 11168 e = mw.event.get(e); 11169 return e.keyCode || e.which; 11170 }, 11171 isKeyCode: function(e, code){ 11172 return this.keyCode(e) === code; 11173 }, 11174 is: { 11175 comma: function (e) { 11176 e = mw.event.get(e); 11177 return e.keyCode === 188; 11178 }, 11179 enter: function (e) { 11180 e = mw.event.get(e); 11181 return e.key === "Enter" || mw.event.isKeyCode(e, 13); 11182 }, 11183 escape: function (e) { 11184 e = mw.event.get(e); 11185 return e.key === "Escape" || mw.event.isKeyCode(e, 27); 11186 }, 11187 backSpace : function (e) { 11188 e = mw.event.get(e); 11189 return e.key === "Backspace" || mw.event.isKeyCode(e, 8); 11190 }, 11191 delete: function (e) { 11192 e = mw.event.get(e); 11193 return e.key === "Delete" || mw.event.isKeyCode(e, 46); 11194 } 11195 } 11196}; 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211// JavaScript Document 11212mw.require('forms.js'); 11213 11214mw.product = { 11215 quick_view: function(product_id, dialog_title) { 11216 $.get(mw.settings.api_url + 'product/quick-view', {id:product_id}, 11217 function (html) { 11218 mw.dialog({ 11219 title: dialog_title, 11220 width: 960, 11221 content: html, 11222 onremove: function () { 11223 11224 }, 11225 name: 'product-quick-view' 11226 }); 11227 } 11228 ); 11229 } 11230}; 11231 11232mw.cart = { 11233 11234 add_and_checkout: function (content_id, price, c) { 11235 if (typeof(c) == 'undefined') { 11236 var c = function () { 11237 window.location.href = mw.settings.api_url + 'shop/redirect_to_checkout'; 11238 } 11239 } 11240 return mw.cart.add_item(content_id, price, c); 11241 }, 11242 11243 add_item: function (content_id, price, c) { 11244 var data = {}; 11245 if (content_id == undefined) { 11246 return; 11247 } 11248 11249 data.content_id = content_id; 11250 11251 if (price != undefined && data != undefined) { 11252 data.price = price; 11253 } 11254 11255 $.post(mw.settings.api_url + 'update_cart', data, 11256 function (data) { 11257 11258 // mw.cart.after_modify(data); 11259 11260 11261 if (typeof c === 'function') { 11262 c.call(data); 11263 } 11264 mw.cart.after_modify(data, ['mw.cart.add']); 11265 mw.trigger('cartAddItem', data); 11266 11267 // mw.trigger('mw.cart.add', [data]); 11268 }); 11269 }, 11270 11271 add: function (selector, price, c) { 11272 var data = mw.form.serialize(selector); 11273 11274 11275 var is_form_valid = true; 11276 mw.$('[required],.required', selector).each(function () { 11277 11278 if (!this.validity.valid) { 11279 is_form_valid = false 11280 11281 var is_form_valid_check_all_fields_tip = mw.tooltip({ 11282 id: 'mw-cart-add-invalid-form-tooltip-show', 11283 content: 'This field is required', 11284 close_on_click_outside: true, 11285 group: 'mw-cart-add-invalid-tooltip', 11286 skin: 'warning', 11287 element: this 11288 }); 11289 11290 11291 return false;
11292 } 11293 }); 11294 11295 if (!is_form_valid) { 11296 return; 11297 } 11298 11299 11300 if (price != undefined && data != undefined) { 11301 data.price = price; 11302 } 11303 if (data.price == null) { 11304 data.price = 0; 11305 } 11306 11307 var formData = new FormData(); 11308 $.each(data, function (k,v) { 11309 formData.append(k,v); 11310 }); 11311 11312 $.ajax({ 11313 url:mw.settings.api_url + 'update_cart', 11314 dataType: 'text', 11315 cache: false, 11316 contentType: false, 11317 processData: false, 11318 data: formData, 11319 type: 'post', 11320 success: function (data) { 11321 11322 // mw.trigger('mw.cart.add', [data]); 11323 11324 if (typeof c === 'function') { 11325 c.call(data); 11326 } 11327 mw.cart.after_modify(data, ['mw.cart.add']); 11328 mw.trigger('cartAddItem', data); 11329 11330 11331 } 11332 }); 11333 }, 11334 11335 remove: function ($id) { 11336 var data = {} 11337 data.id = $id; 11338 11339 $.post(mw.settings.api_url + 'remove_cart_item', data, 11340 function (data) { 11341 var parent = mw.$('.mw-cart-item-' + $id).parent(); 11342 mw.$('.mw-cart-item-' + $id).fadeOut(function () { 11343 mw.$(this).remove(); 11344 if (parent.find(".mw-cart-item").length == 0) { 11345 11346 } 11347 }); 11348 //mw.cart.after_modify(); 11349 // mw.reload_module('shop/cart'); 11350 // mw.reload_module('shop/shipping'); 11351 // mw.trigger('mw.cart.remove', [data]); 11352 mw.cart.after_modify(data, ['mw.cart.remove']); 11353 mw.trigger('cartRemoveItem', data); 11354 11355 }); 11356 }, 11357 11358 qty: function ($id, $qty) { 11359 var data = {} 11360 data.id = $id; 11361 data.qty = $qty; 11362 $.post(mw.settings.api_url + 'update_cart_item_qty', data, 11363 function (data) { 11364 // mw.reload_module('shop/cart'); 11365 // mw.reload_module('shop/shipping'); 11366 // mw.trigger('mw.cart.qty', [data]); 11367 11368 if(data && typeof(data.error) !== 'undefined'){ 11369 if(typeof(data.message) !== 'undefined'){ 11370 mw.notification.warning(data.message); 11371 } 11372 } 11373 11374 mw.cart.after_modify(data, ['mw.cart.qty']); 11375 mw.trigger('cartModify', data); 11376 11377 11378 }); 11379 11380 }, 11381 11382 after_modify: function (data, events_to_trigger) { 11383 11384 11385 var modules = ["shop/cart", "shop/shipping", "shop/payments"].filter(function (module) { 11386 return !!document.querySelector('[data-type="' + module + '"'); 11387 }); 11388 11389 var events = ['mw.cart.modify']; 11390 11391 if (!!events_to_trigger) { 11392 var events = events.concat(events_to_trigger); 11393 } 11394 11395 11396 if (modules.length) { 11397 mw.reload_modules(modules, function (data) { 11398 events.forEach(function (item) { 11399 mw.trigger(item, [data]); 11400 }) 11401 }, true); 11402 } else { 11403 events.forEach(function (item) { 11404 mw.trigger(item, [data]); 11405 }) 11406 } 11407 11408 11409 // mw.reload_module('shop/cart'); 11410 // mw.reload_module('shop/shipping'); 11411 // mw.reload_module('shop/payments'); 11412 11413 11414 if ((typeof data == 'object') && typeof data.cart_items_quantity !== 'undefined') { 11415 $('.js-shopping-cart-quantity').html(data.cart_items_quantity); 11416 } 11417 11418 11419 mw.trigger('mw.cart.after_modify', data); 11420 mw.trigger('cartModify', data); 11421 11422 11423 }, 11424 11425 checkout: function (selector, callback, beforeRedirect) { 11426 11427 if (!beforeRedirect) { 11428 beforeRedirect = function () { 11429 return new Promise(function (){ 11430 resolve(); 11431 }); 11432 }; 11433 } 11434 11435 var form = mw.$(selector); 11436 $(document).trigger("checkoutBeforeProcess", form); 11437 11438 11439 var state = form.dataset("loading"); 11440 if (state == 'true') return false;
11441 form.dataset("loading", 'true'); 11442 form.find('.mw-checkout-btn').attr('disabled', 'disabled'); 11443 form.find('.mw-checkout-btn').hide(); 11444 11445 setTimeout(function () { 11446 11447 var form = mw.$(selector); 11448 var obj = mw.form.serialize(form); 11449 11450 11451 $.ajax({ 11452 type: "POST", 11453 url: mw.settings.api_url + 'checkout', 11454 data: obj, 11455 error: function (xhr, ajaxOptions, thrownError) { 11456 mw.errorsHandle(JSON.parse(xhr.responseText)) 11457 form.dataset("loading", 'false'); 11458 form.find('.mw-checkout-btn').removeAttr('disabled'); 11459 form.find('.mw-checkout-btn').show(); 11460 11461 } 11462 }) 11463 .done(function (data) { 11464 mw.trigger('checkoutDone', data); 11465 11466 var data2 = data; 11467 11468 if (data != undefined) { 11469 mw.$(selector + ' .mw-cart-data-btn').removeAttr('disabled'); 11470 mw.$('[data-type="shop/cart"]').removeAttr('hide-cart'); 11471 11472 11473 if (typeof(data2.error) != 'undefined') { 11474 mw.$(selector + ' .mw-cart-data-holder').show(); 11475 if (typeof(data2.error.address_error) != 'undefined') { 11476 var form_with_err = form; 11477 var isModalForm = $(form_with_err).attr('is-modal-form') 11478 11479 if (isModalForm) { 11480 mw.cart.modal.showStep(form_with_err, 'delivery-address'); 11481 } 11482 mw.notification.error('Please fill your address details'); 11483 11484 } 11485 11486 mw.response(selector, data2); 11487 } else if (typeof(data2.success) != 'undefined') { 11488 11489 11490 if (typeof callback === 'function') { 11491 callback.call(data2.success); 11492 11493 } else if (typeof window[callback] === 'function') { 11494 window[callback](selector, data2.success); 11495 } else { 11496 11497 mw.$('[data-type="shop/cart"]').attr('hide-cart', 'completed'); 11498 mw.reload_module('shop/cart'); 11499 mw.$(selector + ' .mw-cart-data-holder').hide(); 11500 mw.response(selector, data2); 11501 } 11502 11503 11504 11505 11506 11507 if (typeof(data2.redirect) != 'undefined') { 11508 11509 setTimeout(function () { 11510 beforeRedirect().then(function (){ 11511 window.location.href = data2.redirect; 11512 }); 11513 }, 100); 11514 return; 11515 } else { 11516 mw.trigger('mw.cart.checkout.success', data2); 11517 mw.trigger('checkoutSuccess', [data]); 11518 11519 } 11520 11521 11522 } else if (parseInt(data) > 0) { 11523 mw.$('[data-type="shop/checkout"]').attr('view', 'completed'); 11524 mw.reload_module('shop/checkout'); 11525 } else { 11526 if (obj.payment_gw != undefined) { 11527 var callback_func = obj.payment_gw + '_checkout'; 11528 if (typeof window[callback_func] === 'function') { 11529 window[callback_func](data, selector); 11530 } 11531 var callback_func = 'checkout_callback'; 11532 if (typeof window[callback_func] === 'function') { 11533 window[callback_func](data, selector); 11534 } 11535 } 11536 } 11537 11538 } 11539 form.dataset("loading", 'false'); 11540 form.find('.mw-checkout-btn').removeAttr('disabled'); 11541 form.find('.mw-checkout-btn').show();
11542 mw.trigger('checkoutResponse', data); 11543 }); 11544 11545 }, 1500); 11546 } 11547} 11548 11549if (typeof(mw.cart.modal) == 'undefined') { 11550 mw.cart.modal = {}; 11551} 11552if (typeof(mw.cart.modal.init) == 'undefined') { 11553 mw.cart.modal.init = function (root_node) { 11554 mw.cart.modal.bindStepButtons(root_node); 11555 11556 /* 11557 var inner_cart_module = $(root_node).find('[parent-module-id="js-ajax-cart-checkout-process"]')[0]; 11558 */ 11559 var inner_cart_module = $(root_node).find('[id="cart_checkout_js-ajax-cart-checkout-process"]')[0]; 11560 if (inner_cart_module) { 11561 var check = $(document).find('[id="' + inner_cart_module.id + '"]').length 11562 mw.on.moduleReload(inner_cart_module.id); 11563 } 11564 }; 11565} 11566if (typeof(mw.cart.modal.bindStepButtons) == 'undefined') { 11567 11568 mw.cart.modal.bindStepButtons = function (root_node) { 11569 if (typeof root_node === 'string') { 11570 root_node = mw.$(root_node); 11571 } 11572 11573 if (root_node[0]._bindStepButtons) { 11574 return; 11575 } 11576 root_node[0]._bindStepButtons = true; 11577 11578 var checkout_form = $(root_node).find('form').first(); 11579 11580 11581 $('body').on("mousedown touchstart", '.js-show-step', function () { 11582 var step = $(this).attr('data-step'); 11583 11584 mw.cart.modal.showStep(checkout_form, step); 11585 11586 11587 }); 11588 }; 11589 11590 mw.cart.modal.showStep = function (form, step) { 11591 11592 11593 var prevStep = mw.$('.js-show-step.active', form).data('step'); 11594 11595 if (prevStep === step) return; 11596 11597 var prevHolder = $(form).find('.js-' + prevStep).first(); 11598 11599 $(form).attr('is-modal-form', true); 11600 11601 if (step === 'checkout-complete') { 11602 return; 11603 } 11604 11605 var validate = function (callback) { 11606 var hasError = false; 11607 mw.$('input,textarea,select', prevHolder).each(function () { 11608 if (!this.checkValidity()) { 11609 mw.$(this).addClass('is-invalid'); 11610 hasError = true; 11611 } else { 11612 mw.$(this).removeClass('is-invalid'); 11613 } 11614 }); 11615 if (step === 'payment-method' || step === 'preview') { 11616 if (hasError) { 11617 step = 'delivery-address'; 11618 callback.call(undefined, hasError, undefined, step); 11619 } 11620 } 11621 if (step === 'payment-method') { 11622 $.post(mw.settings.api_url + 'checkout/validate', mw.serializeFields(prevHolder), function (data) { 11623 if (!data.valid) { 11624 step = 'delivery-address'; 11625 } 11626 callback.call(undefined, !data.valid, undefined, step); 11627 11628 }).fail(function (data) { 11629 mw.errorsHandle(data) 11630 }); 11631 } else { 11632 callback.call(undefined, hasError, undefined, step); 11633 } 11634 }; 11635 11636 validate(function (hasError, message, step) { 11637 if (hasError) { 11638 message = message || mw.lang('Please fill properly the required fields'); 11639 mw.notification.warning(message); 11640 } 11641 11642 mw.$('.js-show-step').removeClass('active'); 11643 mw.$('[data-step]').removeClass('active'); 11644 mw.$('[data-step="' + step + '"]').addClass('active').parent().removeClass('muted'); 11645 mw.$(this).addClass('active'); 11646 var step1 = '.js-' + step; 11647 mw.$('.js-step-content').hide(); 11648 mw.$(step1).show(); 11649 11650 }); 11651 11652 11653 }; 11654} 11655 11656mw.cart.modal.bindStepButtons__old = function (root_node) { 11657 if (typeof root_node === 'string') { 11658 root_node = mw.$(root_node); 11659 } 11660 11661 if (root_node[0]._bindStepButtons) { 11662 return; 11663 } 11664 root_node[0]._bindStepButtons = true; 11665 11666 root_node.find('.js-show-step').on("mousedown touchstart", function () { 11667 11668 var has_error = false; 11669 11670 var form = mw.tools.firstParentWithTag(this, 'form'); 11671 var prevStep = mw.$('.js-show-step.active', form).data('step'); 11672 var step = this.dataset.step; 11673 11674 if (prevStep === step) return; 11675 11676 11677 var prevHolder = form.querySelector('.js-' + prevStep); 11678 11679 11680 if (step === 'checkout-complete') { 11681 return; 11682 } 11683 mw.$('input,textarea,select', prevHolder).each(function () { 11684 if (!this.checkValidity()) { 11685 mw.$(this).addClass('is-invalid'); 11686 has_error = 1; 11687 } else { 11688 mw.$(this).removeClass('is-invalid'); 11689 } 11690 }); 11691 if (step === 'payment-method' || step === 'preview') { 11692 if (has_error) { 11693 step = 'delivery-address'; 11694 } 11695 }
11696 mw.$('.js-show-step').removeClass('active'); 11697 mw.$('[data-step]').removeClass('active'); 11698 mw.$('[data-step="' + step + '"]').addClass('active').parent().removeClass('muted'); 11699 mw.$(this).addClass('active'); 11700 var step1 = '.js-' + step; 11701 mw.$('.js-step-content').hide(); 11702 mw.$(step1).show(); 11703 if (has_error) { 11704 mw.notification.warning('Please fill the required fields'); 11705 } 11706 }); 11707 11708} 11709 11710 11711$(document).ready(function(){ 11712 mw.$('.mw-lazy-load-module').reload_module(); 11713}); 11714 11715 11716$(document).ready(function(){ 11717 11718 mw.common['data-mw-close'](); 11719 mw.$(document.body) 11720 .on('click', '[data-mw-dialog]', function(e){ 11721 mw.common['data-mw-dialog'](e); 11722 }) 11723 .on('click', '[data-mw-close]', function(e){ 11724 mw.common['data-mw-close'](e); 11725 }); 11726}); 11727 11728mw.common = { 11729 setOptions:function (el, options) { 11730 options = options || {}; 11731 if(el.target){ 11732 el = el.target; 11733 } 11734 var settings = el.getAttribute('data-mw-settings'); 11735 try{ 11736 settings = JSON.parse(settings); 11737 } 11738 catch(e){ 11739 settings = {}; 11740 } 11741 return $.extend(options, settings) 11742 11743 }, 11744 'data-mw-close':function(e){ 11745 if(e && e.target){ 11746 var data = e.target.getAttribute('data-mw-close'); 11747 var cookie = JSON.parse(mw.cookie.get('data-mw-close') || '{}');
11748 mw.$(data).slideUp(function(){ 11749 mw.$(this).remove(); 11750 cookie[data] = true; 11751 mw.cookie.set('data-mw-close', JSON.stringify(cookie)); 11752 }) 11753 } 11754 else{ 11755 var cookie = JSON.parse(mw.cookie.get('data-mw-close') || '{}'); 11756 mw.$('[data-mw-close]').each(function(){ 11757 var data = this.getAttribute('data-mw-dialog'); 11758 if(cookie[data]){ 11759 mw.$(data).remove(); 11760 } 11761 }) 11762 } 11763 }, 11764 'data-mw-dialog':function(e){ 11765 var skin = 'basic'; 11766 var overlay = true; 11767 var data = e.target.getAttribute('data-mw-dialog'); 11768 11769 if(data){ 11770 e.preventDefault(); 11771 data = data.trim(); 11772 var arr = data.split('.'); 11773 var ext = arr[arr.length-1]; 11774 if(data.indexOf('http') === 0){ 11775 if(ext && /(gif|png|jpg|jpeg|bpm|tiff)$/i.test(ext)){ 11776 mw.image.preload(data, function(w,h){ 11777 var html = "<img src='"+data+"'>"; 11778 var conf = mw.common.setOptions(e, { 11779 width:w, 11780 height:h, 11781 content:html, 11782 template:skin, 11783 overlay:overlay, 11784 overlayRemovesModal:true 11785 }) 11786 mw.dialog(conf); 11787 }); 11788 } 11789 else{ 11790 var conf = mw.common.setOptions(e, { 11791 url:data, 11792 width:'90%', 11793 height:'auto%', 11794 template:skin, 11795 overlay:overlay, 11796 overlayRemovesModal:true 11797 }) 11798 mw.dialogIframe(conf) 11799 } 11800 } 11801 else if(data.indexOf('#') === 0 || data.indexOf('.') === 0){ 11802 var conf = mw.common.setOptions(e, { 11803 content:$(data)[0].outerHTML, 11804 template:skin, 11805 overlay:overlay, 11806 overlayRemovesModal:true 11807 }); 11808 mw.dialog(conf); 11809 } 11810 } 11811 } 11812} 11813 11814 11815 mw.components = { 11816 _rangeOnce: false, 11817 'range': function(el){ 11818 mw.lib.require('jqueryui'); 11819 var options = this._options(el); 11820 var defaults = { 11821 range: 'min', 11822 animate: "fast" 11823 }; 11824 var ex = {}, render = el; 11825 if(el.nodeName === 'INPUT'){ 11826 el._pauseChange = false; 11827 el.type = 'text'; 11828 render = document.createElement('div'); 11829 $(el).removeClass('mw-range'); 11830 $(render).addClass('mw-range'); 11831 $(el).after(render); 11832 ex = { 11833 slide: function( event, ui ) { 11834 el._pauseChange = true; 11835 $(el).val(ui.value).trigger('change').trigger('input'); 11836 setTimeout(function () { 11837 el._pauseChange = false; 11838 }, 78); 11839 } 11840 }; 11841 11842 } 11843 var settings = $.extend({}, defaults, options, ex); 11844 if(el.min){ 11845 settings.min = parseFloat(el.min); 11846 } 11847 if(el.max){ 11848 settings.max = parseFloat(el.max); 11849 } 11850 if(el.value){ 11851 settings.value = parseFloat(el.value); 11852 } 11853 mw.$(render) 11854 .slider(settings) 11855 .on('mousedown touchstart', function(){ 11856 mw.$(this).addClass('active'); 11857 }); 11858 $(el).on('input', function(){ 11859 mw.$(render).slider( "value", this.value ); 11860 }); 11861 if(!mw.components._rangeOnce) { 11862 mw.components._rangeOnce = true; 11863 mw.$(document.body).on('mouseup touchend', function(){ 11864 mw.$('.mw-range.active').removeClass('active'); 11865 }); 11866 } 11867 }, 11868 'color-picker': function(el){ 11869 var options = this._options(el); 11870 var defaults = { 11871 position: 'bottom-center' 11872 }; 11873 var settings = $.extend({}, defaults, options); 11874 var nav = document.createElement('div'); 11875 nav.className = 'mw-ui-btn-nav mw-color-picker-holder'; 11876 var view = document.createElement('div'); 11877 view.className = 'mw-ui-btn'; 11878 view.innerHTML = '<span class="mw-ui-btn-img"></span>'; 11879 nav.appendChild(view); 11880 var inputEl; 11881 if(el.nodeName === 'INPUT'){ 11882 inputEl = el; 11883 mw.$(el).addClass('mw-ui-field').after(nav); 11884 nav.appendChild(el); 11885 mw.$('.mw-ui-btn-img', view).css("background-color", el.value); 11886 inputEl._time = null; 11887 } 11888 11889 11890 var picker = mw.colorPicker({ 11891 element:inputEl, 11892 position:settings.position, 11893 onchange:function(color){ 11894 mw.$('.mw-ui-btn-img', view).css("background-color", color); 11895 mw.$(inputEl).trigger('change'); 11896 } 11897 }); 11898 mw.$(view).on("click", function(){ 11899 setTimeout(function(){
11900 picker.toggle(); 11901 }, 10); 11902 }); 11903 }, 11904 'file-uploader':function(el){ 11905 var options = this._options(el); 11906 var defaults = { 11907 element: el 11908 }; 11909 var settings = $.extend({}, defaults, options); 11910 var ch = mw.$(el).attr("onchange"); 11911 11912 mw.fileWindow({ 11913 types:'media', 11914 change:function(url){ 11915 try{ 11916 eval(ch); 11917 } 11918 catch(err){} 11919 } 11920 }); 11921 }, 11922 'modules-tabs':function(el){ 11923 var options = this._options(el); 11924 options.breakPoint = 100; //makes accordion if less then 100px 11925 if(window.live_edit_sidebar) { 11926 mw.$(el).addClass('mw-accordion-window-height') 11927 options.breakPoint = 800; //makes accordion if less then 800px 11928 } 11929 var accordion = this.accordion(el); 11930 var tb = new mw.tabAccordion(options, accordion); 11931 }, 11932 'tab-accordion':function(el){ 11933 var options = this._options(el); 11934 var accordion = this.accordion(el); 11935 var tb = new mw.tabAccordion(options, accordion); 11936 }, 11937 accordion:function(el){ 11938 if(!el || el._accordion) return; 11939 if(!$(el).is(':visible')){ 11940 setTimeout(function(){ 11941 mw.components.accordion(el); 11942 }, 777, el); 11943 return; 11944 } 11945 el._accordion = true; 11946 var options = this._options(el); 11947 var settings = $.extend(options, {element:el}) 11948 var accordion = new mw.uiAccordion(settings); 11949 if($(el).hasClass('mw-accordion-window-height')){ 11950 accordion._setHeight = function(){ 11951 var max = mw.$(window).height() - (accordion.root.offset().top - mw.$(window).scrollTop()); 11952 accordion.root.css('height', max); 11953 var content_max = max - (accordion.titles.length * accordion.titles.eq(0).outerHeight()); 11954 accordion.contents.css('height', content_max); 11955 }; 11956 accordion._setHeight(); 11957 mw.$(window).on('load resize', function(){ 11958 accordion._setHeight(); 11959 }); 11960 if(window !== top){ 11961 mw.$(top).on('load resize', function(){ 11962 accordion._setHeight(); 11963 }); 11964 } 11965 } 11966 if($(el).hasClass('mw-accordion-full-height')){ 11967 accordion._setHeight = function(){ 11968 var max = Math.min($(el).parent().height(), mw.$(window).height()); 11969 accordion.root.css('maxHeight', max); 11970 var content_max = max - (accordion.titles.length * accordion.titles.eq(0).outerHeight()); 11971 accordion.contents.css('maxHeight', content_max); 11972 }; 11973 accordion._setHeight(); 11974 mw.$(window).on('load resize', function(){ 11975 accordion._setHeight(); 11976 }); 11977 if(window !== top){ 11978 mw.$(top).on('load resize', function(){ 11979 accordion._setHeight(); 11980 }); 11981 } 11982 } 11983 return accordion; 11984 }, 11985 postSearch: function (el) { 11986 var defaults = {keyword: el.value, limit: 4}; 11987 el._setValue = function (id) { 11988 mw.tools.ajaxSearch(this._settings, function () { 11989 11990 }); 11991 }; 11992 11993 el = mw.$(el); 11994 var options = JSON.parse(el.attr("data-options") || '{}'); 11995 settings = $.extend({}, defaults, options); 11996 el[0]._settings = settings; 11997 11998 el.wrap("<div class='mw-component-post-search'></div>"); 11999 el.after("<ul></ul>"); 12000 12001 el.on("input focus blur", function (event) { 12002 12003 if (!el[0].is_searching) { 12004 var val = el.val(); 12005 if (event.type == 'blur') { 12006 mw.$(this).next('ul').hide(); 12007 return false; 12008 } 12009 if (event.type == 'focus') { 12010 if ($(this).next('ul').html()) { 12011 mw.$(this).next('ul').show() 12012 } 12013 return false; 12014 } 12015 el[0].is_searching = true; 12016 12017 this._settings.keyword = this.value; 12018 mw.$('ul', el).empty("") 12019 el.parent().addClass("loading"); 12020 mw.tools.ajaxSearch(this._settings, function () { 12021 var lis = []; 12022 var json = this; 12023 for (var item in json) { 12024 var obj = json[item]; 12025 if (typeof obj === 'object') { 12026 var li = document.createElement("li"); 12027 li._value = obj; 12028 li.innerHTML = obj.title; 12029 mw.$(li).on("mousedown touchstart", function () { 12030 el.val(this._value.title); 12031 12032 el[0]._value = this._value; 12033 12034 el.trigger('postSelected', [this._value]); 12035 mw.$(this.parentNode).hide() 12036 }) 12037 12038 lis.push(li); 12039 } 12040 } 12041 el.parent().removeClass("loading"); 12042 var ul = el.parent().find("ul"); 12043 ul.empty().append(lis).show(); 12044 el[0].is_searching = false;
12045 }); 12046 } 12047 }); 12048 el.trigger("postSearchReady"); 12049 }, 12050 _options: function (el) { 12051 return mw.tools.elementOptions(el); 12052 }, 12053 _init: function () { 12054 mw.$('.mw-field input[type="range"]').addClass('mw-range'); 12055 mw.$('[data-mwcomponent], [data-mw-component]').each(function () { 12056 var component = this.dataset.mwComponent || this.dataset.mwcomponent; 12057 if (mw.components[component]) { 12058 mw.components[component](this); 12059 mw.$(this).removeAttr('data-mwcomponent').removeAttr('data-mw-component') 12060 } 12061 }); 12062 $.each(this, function(key){ 12063 if(key.indexOf('_') === -1){ 12064 mw.$('.mw-'+key+', mw-'+key).not(".mw-component-ready").each(function () { 12065 mw.$(this).addClass('mw-component-ready'); 12066 mw.components[key](this); 12067 }); 12068 } 12069 }); 12070 } 12071}; 12072 12073$(document).ready(function () { 12074 mw.components._init(); 12075}); 12076 12077$(window).on('load', function () { 12078 mw.components._init(); 12079}); 12080 12081 mw.on('ComponentsLaunch', function () { 12082 mw.components._init(); 12083 }); 12084 12085 mw.on('mwDialogShow', function () { 12086 setTimeout(function () { 12087 mw.components._init(); 12088 }, 110); 12089 }); 12090 12091$(window).on('ajaxStop', function () { 12092 setTimeout(function () { 12093 mw.components._init(); 12094 }, 100); 12095}); 12096 12097mw.registerComponent = function(name, func){ 12098 if(mw.components[name]){ 12099 console.warn('Component ' + name + ' already exists.'); 12100 return; 12101 } 12102 mw.components[name] = func; 12103}; 12104 12105 12106mw._instrument = function(){ 12107 this._value = null; 12108 var $scope = $(this); 12109 this.value = function(val){ 12110 if (!val) return this._value; 12111 this._value = val; 12112 $scope.trigger('change', [val]); 12113 return this; 12114 }; 12115}; 12116mw.instruments = { 12117 _create:function (config) { 12118 config = config || {}; 12119 var settings = $.extend({}, config); 12120 var frame = document.createElement('iframe'); 12121 frame.src = mw.external_tool(settings.url); 12122 frame.className = 'mw-instrument-frame'; 12123 frame.frameBorder = '0'; 12124 $(frame).css(settings.css || {width: '100%'}).on('load', function () { 12125 mw.instruments._prepareFrame(frame, settings); 12126 }); 12127 return frame; 12128 }, 12129 _prepareFrame: function (frame, settings) { 12130 frame.contentWindow.thisframe = frame; 12131 if(!settings.css || !settings.css.height) { 12132 mw.tools.iframeAutoHeight(frame); 12133 } 12134 }, 12135 _run: {}, 12136 run: function(config){ 12137 if(!config || !config.instrument || !config.id) { 12138 return; 12139 } 12140 config.show = typeof config.show === 'undefined' ? true : config.show; 12141 config.width = config.width || 660; 12142 if(!this._run[config.id]){ 12143 var inst = this[config.instrument]({ 12144 mode: 'inline' 12145 }); 12146 var div = $('<div id="'+config.id+'" />'); 12147 div.hide(); 12148 $(document.body).append(div); 12149 div.append(inst.frame); 12150 this._run[config.id] = inst; 12151 } 12152 if (config.show) { 12153 mw.$('#' + config.id).mwDialog({ 12154 //id: 'mw-instrument-dialog-' + config.id, 12155 width: config.width 12156 }); 12157 } 12158 return this._run[config.id]; 12159 }, 12160 createMode: function(mode, url, id){ 12161 var frame, dialog; 12162 if(mode === 'inline'){ 12163 frame = this._create({ 12164 url: 'link_editor' 12165 }); 12166 } else if(mode === 'dialog') { 12167 var exists = mw.dialog.get('#' + id.replace('#', '')); 12168 if(exists){ 12169 exists.show(); 12170 return { 12171 dialog: exists, 12172 frame: exists.iframe 12173 }; 12174 } 12175 dialog = mw.dialogIframe({ 12176 url: url, 12177 height: 'auto', 12178 autoHeight: true 12179 }); 12180 frame = dialog.iframe; 12181 } else { 12182 return {}; 12183 } 12184 12185 return { 12186 frame: frame, 12187 dialog: dialog 12188 }; 12189 }, 12190 _handlers: {}, 12191 handler: function(id, val){ 12192 if(!val) { 12193 return this._handlers[id]; 12194 } 12195 this._handlers[id] = val; 12196 }, 12197 link: function(config){ 12198 config = config || {}; 12199 var defaults = { 12200 mode: 'dialog' // 'dialog', 'inline' 12201 }; 12202 var settings = $.extend({}, defaults, config); 12203 var frame, dialog; 12204 if(settings.mode === 'inline'){ 12205 frame = this._create({ 12206 url: 'link_editor' 12207 }); 12208 mw.tools.iframeAutoHeight(frame); 12209 } else if(settings.mode === 'dialog') { 12210 dialog = mw.dialogIframe({ 12211 url:' link_editor', 12212 height: 'auto', 12213 autoHeight: true, 12214 width: 800 12215 }); 12216 frame = dialog.iframe; 12217 } else { 12218 return {}; 12219 } 12220 var id = mw.id(); 12221 var final = { 12222 frame: frame, 12223 dialog: dialog, 12224 handler: $({}), 12225 id: id, 12226 window: window 12227 }; 12228 this.handler(id, final); 12229 $(frame).on('load', function(url, target, text){ 12230 this.contentWindow.mw.instrumentData = final; 12231 }); 12232 if(frame.contentWindow && frame.contentWindow.mw){ 12233 frame.contentWindow.mw.instrumentData = final; 12234 } 12235 return final; 12236 }, 12237 file: function(config){ 12238 config = config || {}; 12239 var defaults = { 12240 mode: 'dialog' // 'dialog', 'inline' 12241 }; 12242 var settings = $.extend({}, defaults, config); 12243 var frame, dialog; 12244 var url = 'file_picker'; 12245 if(config.types) { 12246 url += '?types=' + config.types 12247 } 12248 if(settings.mode === 'inline'){ 12249 frame = this._create({ 12250 url: url 12251 }); 12252 } else if(settings.mode === 'dialog') { 12253 dialog = mw.dialogIframe({ 12254 url:url, 12255 height: 'auto', 12256 autoHeight: true 12257 }); 12258 frame = dialog.iframe; 12259 } else { 12260 return {}; 12261 } 12262 var id = mw.id(); 12263 var final = { 12264 frame: frame, 12265 dialog: dialog, 12266 handler: $({}), 12267 id: id, 12268 window: window 12269 }; 12270 this.handler(id, final); 12271 $(frame).on('load', function(url, target, text){ 12272 this.contentWindow.mw.instrumentData = final; 12273 }); 12274 if(frame.contentWindow && frame.contentWindow.mw){ 12275 frame.contentWindow.mw.instrumentData = final; 12276 } 12277 return final; 12278 } 12279}; 12280 12281 12282/*********************** 12283 12284 12285 var myFont = new mw.font(); 12286 12287 12288 //create group of fonts 12289 12290 myFont.set({ 12291 family:{ 12292 Roboto:[300,400], 12293 'Architects Daughter':[400, 700], 12294 }, 12295 subset:["cyrillic","cyrillic-ext","korean","latin-ext"] 12296 }) 12297 12298 //add to group 12299 12300 myFont.add({ 12301 family:{ 12302 Roboto:[100] 12303 } 12304 }) 12305 12306 12307 myFont.remove('Roboto', 100) // removes weight 100 12308 12309 myFont.remove('Roboto') // removes family 12310 12311 12312 12313*************************/ 12314 12315 12316 12317 12318mw.fonts = { 12319 _create:function(){ 12320 var el = document.createElement('link'); 12321 el.rel = 'stylesheet'; 12322 document.documentElement.appendChild(el); 12323 return el; 12324 }, 12325 _unique:function(obj){ 12326 var data = {}; 12327 var n; 12328 for(n in obj){ 12329 data.name = n; 12330 data.weight = obj[n]; 12331 } 12332 return data; 12333 }, 12334 google:{ 12335 create:function(){ 12336 var root = 'https://fonts.googleapis.com/css?'; 12337 var el = mw.fonts._create(); 12338 el._rooturl = root; 12339 el._config = {}; 12340 12341 return el; 12342 }, 12343 remove:function(el, family, weight){ 12344 if(!family){ 12345 mw.$(el).removeAttr('href'); 12346 el._config = {}; 12347 } 12348 else if(!weight){ 12349 if(el._config.family && el._config.family[family]){ 12350 delete el._config.family[family]; 12351 } 12352 this.config(el._config, el) 12353 } 12354 else if(weight && family){ 12355 weight = parseInt(weight, 10) 12356 if(el._config.family && el._config.family[family]){ 12357 for(var i=0; i<el._config.family[family].length; i++){ 12358 el._config.family[family][i] = parseInt(el._config.family[n][i], 10); 12359 } 12360 } 12361 } 12362 }, 12363 setUrl:function(options, el){ 12364 var url = 'family='; 12365 for( var i in options.family){ 12366 url += i + ':'+options.family[i].join(',') + '|'; 12367 } 12368 url = url.substring(0, url.length - 1); 12369 12370 if(options.subset){ 12371 url += '&subset=' + options.subset.join(',') 12372 } 12373 el._config = options; 12374 el.href = el._rooturl + url.replace(/\s/g, '+'); 12375 }, 12376 config:function(options, el, mode){ 12377 12378 /* 12379 { 12380 family:{ 12381 'Roboto': [300,500] , 12382 'Tajawal': [400,700] 12383 }, 12384 12385 subset:["cyrillic","cyrillic-ext","korean","latin-ext"] 12386 } 12387 */ 12388 12389 for(var n in el._config.family){ 12390 for(var i=0; i<el._config.family[n].length; i++){ 12391 el._config.family[n][i] = parseInt(el._config.family[n][i], 10); 12392 } 12393 } 12394 12395 if(mode == 'add'){ 12396 $.each(options.family, function(key,val){ 12397 if(el._config.family && el._config.family[key]){ 12398 options.family[key] = el._config.family[key].concat(options.family[key]); 12399 options.family[key] = options.family[key].filter( function (value, i, self) { 12400 return self.indexOf(value) == i; 12401 }); 12402 } 12403 }); 12404 $.each(el._config.family, function(key,val){ 12405 if(options.family && !options.family[key]){ 12406 options.family[key] = el._config.family[key] 12407 } 12408 }); 12409 } 12410 12411 this.setUrl(options, el) 12412 12413 } 12414 }, 12415 noop:{ 12416 fonts:[], 12417 config:function(){ 12418 12419 } 12420 } 12421} 12422mw.font = function(){ 12423 this.data = {}; 12424 this.init = function(options){ 12425 options = options || {}; 12426 if(options.provider){ 12427 options.provider = options.provider.trim().toLowerCase(); 12428 } 12429 else{ 12430 options.provider = 'google'; 12431 } 12432 if(!this[options.provider]){ 12433 this[options.provider] = mw.fonts[options.provider].create(); 12434 } 12435 this.options = options; 12436 } 12437 this.remove = function(family, weight){ 12438 mw.fonts[this.options.provider].remove(this[options.provider], family, weight); 12439 } 12440 12441 this.add = function(options){ 12442 this.init(options) 12443 mw.fonts[this.options.provider].config(this.options, this[options.provider], 'add'); 12444 }; 12445 12446 this.set = function(options){ 12447 this.init(options); 12448 mw.fonts[this.options.provider].config(this.options, this[options.provider]); 12449 }; 12450 12451 12452} 12453 12454class MWSiteMobileMenuService { 12455 12456 12457 constructor(options = {}) { 12458 var defaults = { 12459 popupTemplate: 'mw-vhmbgr-active-popup' 12460 }; 12461 this.settings = Object.assign({}, defaults, options); 12462 this.init() 12463 } 12464 12465 state = false;
12466 12467 currentMenu = null; 12468 12469 buildSubMenus(ul) { 12470 const holder = document.querySelector('.navigation-holder'); 12471 const cacltop = `${(holder ? holder.offsetHeight : 0)}px`; 12472 const maxHeight = `calc(100vh - ${cacltop})`; 12473 12474 ul.querySelectorAll('ul').forEach(function (node) { 12475 const li = node.parentNode; 12476 const btn = document.createElement("span"); 12477 btn.className = 'mw-vhmbgr-submenu-toggle-button'; 12478 li.classList.add('mw-vhmbgr-submenu-active'); 12479 node.style.maxHeight = maxHeight; 12480 12481 btn.addEventListener("click", function (e) { 12482 li.classList.toggle('mw-vhmbgr-submenu-active'); 12483 node.style.maxHeight = li.classList.contains('mw-vhmbgr-submenu-active') ? maxHeight : ''; 12484 e.preventDefault(); 12485 e.stopPropagation(); 12486 }); 12487 li.prepend(btn); 12488 12489 }); 12490 } 12491 12492 buildMobileMenu(targetMenu) { 12493 if(this.currentMenu) { 12494 this.currentMenu.remove() 12495 } 12496 var ul = document.createElement('ul'); 12497 if(ul && targetMenu.querySelector('ul')){ 12498 ul.innerHTML = targetMenu.querySelector('ul').innerHTML; 12499 ul.querySelectorAll('[style],[class]').forEach(node => { 12500 node.removeAttribute('style') 12501 node.removeAttribute('class'); 12502 }); 12503 12504 const block = document.createElement('div'); 12505 this.$block = block; 12506 const ovl = document.createElement('div'); 12507 ovl.className = 'mw-vhmbgr-active-overlay'; 12508 block.className = this.settings.popupTemplate; 12509 this.currentMenu = block; 12510 12511 ovl.addEventListener('click', e => { 12512 this.mobileMenu(undefined, false) 12513 }); 12514 12515 this.buildSubMenus(ul) 12516 12517 12518 block.append(ul) 12519 document.body.append(ovl) 12520 document.body.append(block) 12521 } 12522 12523 12524 } 12525 12526 12527 mobileMenu (node, state) { 12528 var action = 'toggle'; 12529 if(state === true) { 12530 action = 'add' 12531 } else if(state === false) { 12532 action = 'remove' 12533 } 12534 12535 12536 if(node) { 12537 node.classList[action]('mw-vhmbgr-active'); 12538 } else { 12539 Array.from(document.querySelectorAll('.mw-vhmbgr')).forEach(node => { 12540 node.classList[action]('mw-vhmbgr-active'); 12541 }) 12542 } 12543 12544 const holder = document.querySelector('.navigation-holder'); 12545 this.$block.style.top = `${(holder ? holder.offsetHeight : 0)}px`; 12546 this.$block.style.maxHeight = `calc(100vh - ${this.$block.style.top})`; 12547 12548 document.body.classList[action]('mw-vhmbgr-menu-active'); 12549 } 12550 12551 init() { 12552 12553 12554 12555 document.body.addEventListener('click', (e) => { 12556 this.mobileMenu(undefined, false) 12557 }); 12558 12559 const nav = document.querySelector('.mw-vhmbgr--navigation'); 12560 12561 if(nav) { 12562 this.buildMobileMenu(nav); 12563 } 12564 12565 12566 Array.from(document.querySelectorAll('.mw-vhmbgr')).forEach(node => { 12567 node.addEventListener('click', e => { 12568 this.mobileMenu(node); 12569 e.preventDefault(); 12570 e.stopPropagation(); 12571 }) 12572 }) 12573 12574 } 12575 12576} 12577 12578 12579 12580const MWSiteMobileMenu = ( options, hamburger = 5) => { 12581 options.threshold = options.threshold || 800; 12582 options.color = options.color || '#111'; 12583 options.size = options.size || '55px'; 12584 const hamburgers = [ 12585 12586 ` 12587 <svg class="mw-vhmbgr mw-vhmbgrRotate mw-vhmbgr1" viewBox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 30,33 h 40 c 0,0 9.044436,-0.654587 9.044436,-8.508902 0,-7.854315 -8.024349,-11.958003 -14.89975,-10.85914 -6.875401,1.098863 -13.637059,4.171617 -13.637059,16.368042 v 40"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 30,50 h 40"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 30,67 h 40 c 12.796276,0 15.357889,-11.717785 15.357889,-26.851538 0,-15.133752 -4.786586,-27.274118 -16.667516,-27.274118 -11.88093,0 -18.499247,6.994427 -18.435284,17.125656 l 0.252538,40"/></svg> 12588 `, 12589 ` 12590 <svg class="mw-vhmbgr mw-vhmbgr2" viewBox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 70,33 h -40 c -6.5909,0 -7.763966,-4.501509 -7.763966,-7.511428 0,-4.721448 3.376452,-9.583771 13.876919,-9.583771 14.786182,0 11.409257,14.896182 9.596449,21.970818 -1.812808,7.074636 -15.709402,12.124381 -15.709402,12.124381"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 30,50 h 40"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 70,67 h -40 c -6.5909,0 -7.763966,4.501509 -7.763966,7.511428 0,4.721448 3.376452,9.583771 13.876919,9.583771 14.786182,0 11.409257,-14.896182 9.596449,-21.970818 -1.812808,-7.074636 -15.709402,-12.124381 -15.709402,-12.124381"/></svg> 12591 `, 12592 12593 ` 12594 <svg class="mw-vhmbgr mw-vhmbgrRotate mw-vhmbgr4" viewBox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 70,33 h -40 c 0,0 -8.5,-0.149796 -8.5,8.5 0,8.649796 8.5,8.5 8.5,8.5 h 20 v -20"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 70,50 h -40"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 30,67 h 40 c 0,0 8.5,0.149796 8.5,-8.5 0,-8.649796 -8.5,-8.5 -8.5,-8.5 h -20 v 20"/></svg> 12595 `, 12596 ` 12597 <svg class="mw-vhmbgr mw-vhmbgrRotate180 mw-vhmbgr5" viewB
12597ox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 30,33 h 40 c 0,0 8.5,-0.68551 8.5,10.375 0,8.292653 -6.122707,9.002293 -8.5,6.625 l -11.071429,-11.071429"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 70,50 h -40"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 30,67 h 40 c 0,0 8.5,0.68551 8.5,-10.375 0,-8.292653 -6.122707,-9.002293 -8.5,-6.625 l -11.071429,11.071429"/></svg> 12598 `, 12599 ` 12600 <svg class="mw-vhmbgr mw-vhmbgr6" viewBox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 30,33 h 40 c 13.100415,0 14.380204,31.80258 6.899646,33.421777 -24.612039,5.327373 9.016154,-52.337577 -12.75751,-30.563913 l -28.284272,28.284272"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 70,50 c 0,0 -32.213436,0 -40,0 -7.786564,0 -6.428571,-4.640244 -6.428571,-8.571429 0,-5.895471 6.073743,-11.783399 12.286435,-5.570707 6.212692,6.212692 28.284272,28.284272 28.284272,28.284272"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 69.575405,67.073826 h -40 c -13.100415,0 -14.380204,-31.80258 -6.899646,-33.421777 24.612039,-5.327373 -9.016154,52.337577 12.75751,30.563913 l 28.284272,-28.284272"/></svg> 12601 `, 12602 ` 12603 <svg class="mw-vhmbgr mw-vhmbgrRotate mw-vhmbgr7" viewBox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 70,33 h -40 c 0,0 -6,1.368796 -6,8.5 0,7.131204 6,8.5013 6,8.5013 l 20,-0.0013"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 70,50 h -40"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 69.575405,67.073826 h -40 c -5.592752,0 -6.873604,-9.348582 1.371031,-9.348582 8.244634,0 19.053564,21.797129 19.053564,12.274756 l 0,-40"/></svg> 12604 `, 12605 ` 12606 <svg class="mw-vhmbgr mw-vhmbgrRotate mw-vhmbgr8" viewBox="0 0 100 100"><path class="mw-vhmbgr--line mw-vhmbgr--top" d="m 30,33 h 40 c 3.722839,0 7.5,3.126468 7.5,8.578427 0,5.451959 -2.727029,8.421573 -7.5,8.421573 h -20"/><path class="mw-vhmbgr--line mw-vhmbgr--middle" d="m 30,50 h 40"/><path class="mw-vhmbgr--line mw-vhmbgr--bottom" d="m 70,67 h -40 c 0,0 -7.5,-0.802118 -7.5,-8.365747 0,-7.563629 7.5,-8.634253 7.5,-8.634253 h 20"/></svg> 12607 12608 `, 12609 12610 ]; 12611 12612 12613 var curr = document.getElementById('mw-vhmbgr--style'); 12614 if(curr) { 12615 curr.remove() 12616 } 12617 var css = document.createElement('style'); 12618 css.id = `mw-vhmbgr--style`; 12619 css.textContent = ` 12620 12621 12622 12623 .mw-vhmbgr-active-popup, 12624.mw-vhmbgr-active-overlay{ 12625 opacity: 0; 12626 visibility: hidden; 12627 pointer-events: none; 12628 transition: .5s; 12629} 12630body.mw-vhmbgr-menu-active .mw-vhmbgr-active-popup, 12631body.mw-vhmbgr-menu-active .mw-vhmbgr-active-overlay{ 12632 opacity: 1; 12633 visibility: visible; 12634 pointer-events: all; 12635} 12636 12637 12638.mw-vhmbgr-active-popup li{ 12639 list-style: none; 12640 } 12641 .mw-vhmbgr-active-popup > ul{ 12642 max-height: calc(100vh - 200px); 12643 overflow: auto; 12644 padding: 20px; 12645 } 12646 .mw-vhmbgr-active-popup{ 12647 position: fixed; 12648 z-index: 51; 12649 top: 100px; 12650 left: 50%; 12651 transform: translateX(-50%); 12652 background-color: #fff; 12653 box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px; 12654 min-width: 300px; 12655 12656 } 12657 .mw-vhmbgr-active-overlay{ 12658 position: fixed; 12659 z-index: 50; 12660 top: 0; 12661 left: 0; 12662 width: 100%; 12663 height: 100%; 12664 background-color: rgba(0,0,0,.2); 12665 } 12666 12667 12668.mw-vhmbgr { 12669 cursor: pointer; 12670 -webkit-tap-highlight-color: transparent; 12671 transition: transform 400ms; 12672 -moz-user-select: none; 12673 -webkit-user-select: none; 12674 -ms-user-select: none; 12675 user-select: none; 12676 width: var(--size); 12677 color: var(--color); 12678} 12679 12680 12681.mw-vhmbgrRotate.mw-vhmbgr-active { 12682 transform: rotate(45deg); 12683} 12684.mw-vhmbgrRotate180.mw-vhmbgr-active { 12685 transform: rotate(180deg); 12686} 12687.mw-vhmbgr--line { 12688 fill:none; 12689 transition: stroke-dasharray 400ms, stroke-dashoffset 400ms; 12690 stroke: currentColor; 12691 stroke-width:5.5; 12692 stroke-linecap:round; 12693} 12694.mw-vhmbgr1 .mw-vhmbgr--top { 12695 stroke-dasharray: 40 139; 12696} 12697.mw-vhmbgr1 .mw-vhmbgr--bottom { 12698 stroke-dasharray: 40 180; 12699} 12700.mw-vhmbgr1.mw-vhmbgr-active .mw-vhmbgr--top { 12701 stroke-dashoffset: -98px; 12702} 12703.mw-vhmbgr1.mw-vhmbgr-active .mw-vhmbgr--bottom { 12704 stroke-dashoffset: -138px; 12705} 12706.mw-vhmbgr2 .mw-vhmbgr--top { 12707 stroke-dasharray: 40 121; 12708} 12709.mw-vhmbgr2 .mw-vhmbgr--bottom { 12710 stroke-dasharray: 40 121; 12711} 12712.mw-vhmbgr2.mw-vhmbgr-active .mw-vhmbgr--top { 12713 stroke-dashoffset: -102px; 12714} 12715.mw-vhmbgr2.mw-vhmbgr-active .mw-vhmbgr--bottom { 12716 stroke-dashoffset: -102px; 12717} 12718.mw-vhmbgr3 .mw-vhmbgr--top { 12719 stroke-dasharray: 40 130; 12720} 12721.mw-vhmbgr3 .mw-vhmbgr--middle { 12722 stroke-dasharray: 40 140; 12723} 12724.mw-vhmbgr3 .mw-vhmbgr--bottom { 12725 stroke-dasharray: 40 205; 12726} 12727.mw-vhmbgr3.mw-vhmbgr-active .mw-vhmbgr--top { 12728 stroke-dasharray: 75 130; 12729 stroke-dashoffset: -63px; 12730} 12731.mw-vhmbgr3.mw-vhmbgr-active .mw-vhmbgr--middle { 12732 stroke-dashoffset: -102px; 12733} 12734.mw-vhmbgr3.mw-vhmbgr-active .mw-vhmbgr--bottom { 12735 stroke-dasharray: 110 205; 12736 stroke-dashoffset: -86px; 12737} 12738.mw-vhmbgr4 .mw-vhmbgr--top { 12739 stroke-dasharray: 40 121; 12740} 12741.mw-vhmbgr4 .mw-vhmbgr--bottom { 12742 stroke-dasharray: 40 121; 12743} 12744.mw-vhmbgr4.mw-vhmbgr-active .mw-vhmbgr--top { 12745 stroke-dashoffset: -68px; 12746} 12747.mw-vhmbgr4.mw-vhmbgr-active .mw-vhmbgr--bottom { 12748 stroke-dashoffset: -68px; 12749} 12750.mw-vhmbgr5 .mw-vhmbgr--top { 12751 stroke-dasharray: 40 82; 12752} 12753.mw-vhmbgr5 .mw-vhmbgr--bottom { 12754 stroke-dasharray: 40 82; 12755} 12756.mw-vhmbgr5.mw-vhmbgr-active .mw-vhmbgr--top { 12757 stroke-dasharray: 14 82;
12758 stroke-dashoffset: -72px; 12759} 12760.mw-vhmbgr5.mw-vhmbgr-active .mw-vhmbgr--bottom { 12761 stroke-dasharray: 14 82; 12762 stroke-dashoffset: -72px; 12763} 12764.mw-vhmbgr6 .mw-vhmbgr--top { 12765 stroke-dasharray: 40 172; 12766} 12767.mw-vhmbgr6 .mw-vhmbgr--middle { 12768 stroke-dasharray: 40 111; 12769} 12770.mw-vhmbgr6 .mw-vhmbgr--bottom { 12771 stroke-dasharray: 40 172; 12772} 12773.mw-vhmbgr6.mw-vhmbgr-active .mw-vhmbgr--top { 12774 stroke-dashoffset: -132px; 12775} 12776.mw-vhmbgr6.mw-vhmbgr-active .mw-vhmbgr--middle { 12777 stroke-dashoffset: -71px; 12778} 12779.mw-vhmbgr6.mw-vhmbgr-active .mw-vhmbgr--bottom { 12780 stroke-dashoffset: -132px; 12781} 12782.mw-vhmbgr7 .mw-vhmbgr--top { 12783 stroke-dasharray: 40 82; 12784} 12785.mw-vhmbgr7 .mw-vhmbgr--middle { 12786 stroke-dasharray: 40 111; 12787} 12788.mw-vhmbgr7 .mw-vhmbgr--bottom { 12789 stroke-dasharray: 40 161; 12790} 12791.mw-vhmbgr7.mw-vhmbgr-active .mw-vhmbgr--top { 12792 stroke-dasharray: 17 82; 12793 stroke-dashoffset: -62px; 12794} 12795.mw-vhmbgr7.mw-vhmbgr-active .mw-vhmbgr--middle { 12796 stroke-dashoffset: 23px; 12797} 12798.mw-vhmbgr7.mw-vhmbgr-active .mw-vhmbgr--bottom { 12799 stroke-dashoffset: -83px; 12800} 12801.mw-vhmbgr8 .mw-vhmbgr--top { 12802 stroke-dasharray: 40 160; 12803} 12804.mw-vhmbgr8 .mw-vhmbgr--middle { 12805 stroke-dasharray: 40 142; 12806 transform-origin: 50%; 12807 transition: transform 400ms; 12808} 12809.mw-vhmbgr8 .mw-vhmbgr--bottom { 12810 stroke-dasharray: 40 85; 12811 transform-origin: 50%; 12812 transition: transform 400ms, stroke-dashoffset 400ms; 12813} 12814.mw-vhmbgr8.mw-vhmbgr-active .mw-vhmbgr--top { 12815 stroke-dashoffset: -64px; 12816} 12817.mw-vhmbgr8.mw-vhmbgr-active .mw-vhmbgr--middle { 12818 12819 transform: rotate(90deg); 12820} 12821.mw-vhmbgr8.mw-vhmbgr-active .mw-vhmbgr--bottom { 12822 stroke-dashoffset: -64px; 12823} 12824 12825.mw-vhmbgr-wrapper{ 12826 position: relative; 12827 display: block; 12828 width: var(--size); 12829 height: var(--size); 12830 overflow: hidden; 12831} 12832 12833.mw-vhmbgr-wrapper > svg{ 12834 position: absolute; 12835 width: 200%; 12836 height: 200%; 12837 left: -50%; 12838 top: -50%; 12839} 12840 12841 12842 .mw-vhmbgr, .mw-vhmbgr-wrapper { 12843 --size: ${options.size}; 12844 --color: ${options.color} 12845 } 12846 12847 .mw-vhmbgr-wrapper{ 12848 display: none; 12849 } 12850 @media (max-width: ${options.threshold}px) { 12851 .mw-vhmbgr--navigation{ 12852 display: none; 12853 } 12854 .mw-vhmbgr-wrapper{ 12855 display: block; 12856 } 12857 } 12858 12859 `; 12860 document.body.append(css); 12861 document.querySelectorAll('.mw-vhmbgr--navigation').forEach(function(node){ 12862 var mobileMenu = document.createElement('span'); 12863 mobileMenu.className = 'mw-vhmbgr-wrapper'; 12864 mobileMenu.innerHTML = hamburgers[hamburger]; 12865 node.after(mobileMenu); 12866 }); 12867 12868 new MWSiteMobileMenuService(options); 12869}; 12870 12871if(window.mw) { 12872 window.mw.MWSiteMobileMenu = MWSiteMobileMenu 12873} 12874 12875 12876 12877 12878 12879 12880 12881 12882$(window).on('load', function(){ 12883 if(typeof $().emulateTransitionEnd === 'function'){ 12884 $(".modal").each(function(){ 12885 var selector = 'form[action*="/api/"], form.mw-checkout-form'; 12886 var hasMWForm = $(selector, this).length; 12887 if(hasMWForm){ 12888 $(this).on('shown.bs.modal', function() { 12889 $(document).off('focusin.modal'); 12890 }); 12891 } 12892 }) 12893 } 12894}) 12895 12896 $(document).ready(function () { 12897 12898 if (typeof (mw.cookie) !== 'object') { 12899 return; 12900 } 12901 12902 var tokenFromCookie = mw.cookie.get("XSRF-TOKEN"); 12903 if (typeof (tokenFromCookie) === 'undefined') { 12904 setTimeout(function () { 12905 $.post(route('csrf'), function (data) { 12906 tokenFromCookie = mw.cookie.get("XSRF-TOKEN"); 12907 if (typeof tokenFromCookie !== 'undefined') { 12908 $.ajaxSetup({ 12909 headers: { 12910 'X-XSRF-TOKEN': tokenFromCookie 12911 } 12912 }); 12913 } 12914 }); 12915 }, 1337); 12916 } else { 12917 $.ajaxSetup({ 12918 headers: { 12919 'X-XSRF-TOKEN': tokenFromCookie 12920 } 12921 }); 12922 } 12923 12924}); 12925 12926 12927 12928mw.session = { 12929 checkPause: false, 12930 checkPauseExplicitly: false, 12931 check: function (callback) { 12932 if (!mw.session.checkPause) { 12933 mw.session.checkPause = true; 12934 if (mw.session.checkPauseExplicitly) { 12935 return false; 12936 } 12937 $.post(mw.settings.api_url + "is_logged", function (data) { 12938 if (data === null) { 12939 return; 12940 } 12941 if (data !== false) { 12942 if (typeof callback === 'function') { 12943 callback.call(undefined, true); 12944 } 12945 12946 } 12947 else { 12948 if (typeof callback === 'function') { 12949 callback.call(undefined, false) 12950 } 12951 12952 } 12953 mw.session.checkPause = false;
12954 }); 12955 } 12956 }, 12957 logRequest: function () { 12958 var modal = mw.dialog({ 12959 html: "<h3 style='margin:0;'>" + mw.msg.session_expired + ".</h3> <p style='margin:0;'>" + mw.msg.login_to_continue + ".</p> <br> <div id='session_popup_login'></div>", 12960 id: "session_modal", 12961 name: "session_modal", 12962 overlay: true, 12963 width: 400, 12964 height: 300, 12965 template: 'mw_modal_basic', 12966 callback: function () { 12967 mw.load_module("users/login", '#session_popup_login', false, {template: 'popup'}); 12968 } 12969 }); 12970 }, 12971 checkInit: function () { 12972 if (self !== top) { 12973 return false; 12974 } 12975 setInterval(function () { 12976 mw.session.check(function (is_logged) { 12977 if (is_logged) { 12978 var m = mw.dialog.get("#session_modal"); 12979 if (m) { 12980 m.remove(); 12981 } 12982 } 12983 else { 12984 mw.session.logRequest(); 12985 } 12986 }); 12987 }, 300000); // 5 minutes 12988 } 12989} 12990$(document).ready(function () { 12991 12992 mw.$(document).on("ajaxSend",function () { 12993 12994 mw.session.checkPause = true; 12995 }).bind("ajaxComplete", function () { 12996 mw.session.checkPause = false; 12997 }); 12998}); 12999;(function (){ 13000 13001 13002 13003 13004 mw.__pageAnimations = mw.__pageAnimations || []; 13005 13006 13007 13008 var prefix = 'animate__'; 13009 var suffix = 'animated'; 13010 var __initialHiddenClass = 'mw-anime--InitialHidden'; 13011 13012 var stop = function(target){ 13013 if(!target) { 13014 return; 13015 } 13016 13017 Array.from( target.classList ) 13018 .filter(function (cls){ 13019 return cls.indexOf(prefix) === 0; 13020 }) 13021 .forEach(function (cls){ 13022 target.classList.remove(cls) 13023 }) 13024 }; 13025 var animateCSS = function(options){ 13026 13027 if(!options || !options.animation || options.animation === 'none') { 13028 return; 13029 } 13030 13031 var selector = options.selector, 13032 removeAtEnd = options.animation, 13033 animation = options.animation, 13034 speed = options.speed; 13035 var cb = options.callback; 13036 if(typeof speed === 'number') { 13037 speed = speed + 's' 13038 } 13039 13040 13041 var animationName = prefix + animation; 13042 var node = selector; 13043 if(typeof selector === 'string') { 13044 node = document.querySelector(selector); 13045 } 13046 if(!node) { 13047 return; 13048 } 13049 node.classList.remove(__initialHiddenClass) 13050 if (speed) { 13051 node.style.setProperty('--animate-duration', speed); 13052 } 13053 var isInline = getComputedStyle(node).display === 'inline'; 13054 13055 if(isInline) { 13056 node.style.display = 'inline-block'; 13057 var ms = parseFloat(speed) * 1000; 13058 setTimeout(function (){ 13059 node.style.display = ''; 13060 }, ms+10) 13061 } 13062 node.classList.add(prefix + suffix, animationName); 13063 function handleAnimationEnd(event) { 13064 event.stopPropagation(); 13065 node.classList.remove(prefix + suffix, animationName); 13066 if (cb) { 13067 cb.call(); 13068 } 13069 } 13070 node.addEventListener('animationend', handleAnimationEnd, { once: true }); 13071 }; 13072 13073 mw.__animate = animateCSS; 13074 13075 var __animationTypes = { 13076 onAppear: function (data) { 13077 if ('IntersectionObserver' in window) { 13078 var filter = function (item) { 13079 return item.when === 'onAppear'; 13080 } 13081 var nodes = []; 13082 ;(data || []).filter(filter).forEach(function (item) { 13083 var node = document.querySelector(item.selector); 13084 if(node) { 13085 if(!node.$$mwAnimations) { 13086 node.$$mwAnimations = []; 13087 } 13088 var has = node.$$mwAnimations.find(filter); 13089 if (!has) { 13090 node.$$mwAnimations.push(item); 13091 nodes.push(node); 13092 } 13093 } 13094 13095 }); 13096 13097 if (!mw.settings.liveEdit && nodes.length) { 13098 var observer = new IntersectionObserver(function(entries, observer) {
13099 entries.forEach(function(el) { 13100 if(!el.target.$$mwAnimationDone && el.isIntersecting) { 13101 el.target.$$mwAnimationDone = true; 13102 animateCSS(el.target.$$mwAnimations.find(filter)); 13103 } 13104 }); 13105 }); 13106 nodes.forEach(function(el) { 13107 observer.observe(el); 13108 }); 13109 } 13110 } 13111 }, 13112 onHover: function (data) { 13113 var filter = function (item) { 13114 return item.when === 'onHover'; 13115 } 13116 ;(data || []).filter(filter).forEach(function (item){ 13117 var node = document.querySelector(item.selector); 13118 if(node) { 13119 if (!node.$$mwAnimations) { 13120 node.$$mwAnimations = []; 13121 } 13122 var has = node.$$mwAnimations.find(filter); 13123 if ( !has) { 13124 node.$$mwAnimations.push(item); 13125 if(!mw.settings.liveEdit) { 13126 node.addEventListener('mouseenter', function (){ 13127 animateCSS(this.$$mwAnimations.find(filter)) 13128 }) 13129 } 13130 } 13131 } 13132 13133 }); 13134 }, 13135 onClick: function (data) { 13136 var filter = function (item) { 13137 return item.when === 'onClick'; 13138 } 13139 ;(data || []).filter(filter).forEach(function (item){ 13140 var node = document.querySelector(item.selector); 13141 if(node) { 13142 if (!node.$$mwAnimations) { 13143 node.$$mwAnimations = []; 13144 } 13145 var has = node.$$mwAnimations.find(filter); 13146 if (!has) { 13147 node.$$mwAnimations.push(item) 13148 if(!mw.settings.liveEdit) { 13149 node.addEventListener('click', function (){ 13150 animateCSS(this.$$mwAnimations.find(filter)) 13151 }); 13152 } 13153 13154 } 13155 } 13156 13157 }); 13158 } 13159 } 13160 13161 13162 var _animateInit = false; 13163 window.animateInit = function (data) { 13164 13165 if(!_animateInit) { 13166 _animateInit = true; 13167 var style = document.createElement('style'); 13168 style.innerHTML = '.' + __initialHiddenClass + '{ opacity:0; pointer-events: none; }'; 13169 document.getElementsByTagName('head')[0].appendChild(style); 13170 } 13171 13172 data.forEach(function (item) { 13173 if(item.hidden) { 13174 var node = document.querySelector(item.selector); 13175 if (node) { 13176 node.classList.add(__initialHiddenClass) 13177 } 13178 } 13179 }); 13180 for (let i in __animationTypes) { 13181 if (__animationTypes.hasOwnProperty(i)){ 13182 __animationTypes[i](data); 13183 } 13184 } 13185 }; 13186 13187 addEventListener('DOMContentLoaded', function (){ 13188 animateInit(mw.__pageAnimations); 13189 }) 13190 addEventListener('load', function (){ 13191 animateInit(mw.__pageAnimations); 13192 }); 13193 13194 13195})(); 13196const renderBgVideos = function() { 13197 13198 function rend(root) { 13199 Array.from(root.querySelectorAll('[data-mwvideo]')).forEach(function(node){ 13200 var url = node.dataset.mwvideo.trim(); 13201 node.innerHTML = `<video src="${url}" autoplay muted loop playsinline></video>`; 13202 }); 13203 } 13204 13205 rend(document); 13206 13207 const frame = document.querySelector('#live-editor-frame'); 13208 if(frame && frame.contentDocument) { 13209 rend(frame.contentDocument); 13210 } 13211 13212} 13213 13214renderBgVideos(); 13215 13216addEventListener('DOMContentLoaded', e => renderBgVideos()); 13217addEventListener('load', e => renderBgVideos()); 13218 13219 13220
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.