0byt3m1n1
Path:
/
home
/
mgatv524
/
cupim.mgaplay.com.br
/
web
/
dist
/
[
Home
]
File: campaignBuilder.bundle.min.js
!function(){var e={20453:function(e,t,a){var n=document.querySelector("meta[name='public-path']").content;a.p=n+"dist/"},46426:function(e,t,a){(e.exports=a(23645)(!1)).push([e.id,"/*!\n * Copyright (C) 2023 Xibo Signage Ltd\n *\n * Xibo - Digital Signage - http://www.xibo.org.uk\n *\n * This file is part of Xibo.\n *\n * Xibo is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * any later version.\n *\n * Xibo is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Xibo. If not, see <http://www.gnu.org/licenses/>.\n *//*!\n * Copyright (C) 2022 Xibo Signage Ltd\n *\n * Xibo - Digital Signage - http://www.xibo.org.uk\n *\n * This file is part of Xibo.\n *\n * Xibo is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * any later version.\n *\n * Xibo is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Xibo. If not, see <http://www.gnu.org/licenses/>.\n */#content-wrapper .page-content>.row>div{margin:0}#content-wrapper .page-content>.row.header.header-side{height:50px;margin-bottom:0}#content-wrapper .page-content>.row.header.header-side .navbar-toggler-side{margin-top:8px;margin-right:8px}#content-wrapper .page-content>.row.header.header-side .user>.item{width:auto;height:50px;padding-right:16px}#content-wrapper .page-content>.row.header.header-side .user>.item>a{padding:7px 0}#content-wrapper .page-content>.row.header.header-side .user>.item img.nav-avatar{width:36px;height:36px;border-radius:2px}#content-wrapper .page-content>.row.header.header-side .xibo-logo-container{margin-left:50%;transform:translateX(-50%)}#content-wrapper .page-content>.row.header.header-side .xibo-logo-container .page{width:auto;padding:0}#content-wrapper .page-content>.row.header.header-side .xibo-logo-container .page .xibo-logo{height:30px;margin:10px 0}#content-wrapper .page-content>.row.header.header-side .user-notif>.item>a{padding:5px 0}#campaign-builder{margin-top:-30px}#campaign-builder .back-button{position:relative;top:-12px;left:0}#campaign-builder .back-button span{margin-left:6px;font-weight:bold}",""])},23645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var a=function(e,t){var a,n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var r=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([r]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+a+"}":a})).join("")},t.i=function(e,a){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var r=this[i][0];null!=r&&(n[r]=!0)}for(i=0;i<e.length;i++){var o=e[i];null!=o[0]&&n[o[0]]||(a&&!o[2]?o[2]=a:a&&(o[2]="("+o[2]+") and ("+a+")"),t.push(o))}},t}},70749:function(e,t,a){var n=a(93379),i=a(46426);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);n(i,{insert:"head",singleton:!1}),e.exports=i.locals||{}},93379:function(e,t,a){"use strict";var n,i=function(){var e={};return function(t){if(void 0===e[t]){var a=document.querySelector(t);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch(e){a=null}e[t]=a}return e[t]}}(),r=[];function o(e){for(var t=-1,a=0;a<r.length;a++)if(r[a].identifier===e){t=a;break}return t}function s(e,t){for(var a={},n=[],i=0;i<e.length;i++){var s=e[i],l=t.base?s[0]+t.base:s[0],d=a[l]||0,c="".concat(l," ").concat(d);a[l]=d+1;var u=o(c),p={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(r[u].references++,r[u].updater(p)):r.push({identifier:c,updater:h(p,t),references:1}),n.push(c)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var r=a.nc;r&&(n.nonce=r)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var o=i(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var d,c=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function u(e,t,a,n){var i=a?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=c(t,i);else{var r=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(r,o[t]):e.appendChild(r)}}function p(e,t,a){var n=a.css,i=a.media,r=a.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var f=null,m=0;function h(e,t){var a,n,i;if(t.singleton){var r=m++;a=f||(f=l(t)),n=u.bind(null,a,r,!1),i=u.bind(null,a,r,!0)}else a=l(t),n=p.bind(null,a,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(a)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n));var a=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<a.length;n++){var i=o(a[n]);r[i].references--}for(var l=s(e,t),d=0;d<a.length;d++){var c=o(a[d]);0===r[c].references&&(r[c].updater(),r.splice(c,1))}a=l}}}}},t={};function a(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={id:n,exports:{}};return e[n](r,r.exports,a),r.exports}a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),function(){var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e}(),a.nc=void 0,a(20453),a(70749),window.cB={$container:null,$layoutSelect:null,templateLayoutAddForm:null,layoutAssignments:null,map:null,initialise:function(e){this.$container=e},initialiseMap:function(e,t){null!==this.map&&this.map.remove();var a=$("#"+e),n=t.find('input[name="geoFence"]');this.map=L.map(e).setView([this.getDataProperty(a,"mapLat","51"),this.getDataProperty(a,"mapLong","0.4")],this.getDataProperty(a,"mapZoom",13)),L.tileLayer(this.getDataProperty(a,"mapTileServer"),{attribution:this.getDataProperty(a,"mapAttribution",'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'),subdomains:["a","b","c"]}).addTo(this.map);var i=new L.FeatureGroup;this.map.addLayer(i);var r=new L.Control.Draw({position:"topright",draw:{polyline:!1,circle:!1,marker:!1,circlemarker:!1},edit:{featureGroup:i}});this.map.addControl(r);var o=new L.Control.Search({url:"https://nominatim.openstreetmap.org/search?format=json&q={s}",jsonpParam:"json_callback",propertyName:"display_name",propertyLoc:["lat","lon"],marker:L.circleMarker([0,0],{radius:30}),autoCollapse:!0,autoType:!1,minLength:2,hideMarkerOnCollapse:!0,firstTipSubmit:!0});this.map.addControl(o),this.map.on("draw:created",(function(e){i.addLayer(e.layer),n.val(JSON.stringify(i.toGeoJSON()))})),this.map.on("draw:edited",(function(e){n.val(JSON.stringify(i.toGeoJSON()))})),this.map.on("draw:deleted",(function(e){e.layers.eachLayer((function(e){i.removeLayer(e)})),n.val(JSON.stringify(i.toGeoJSON()))})),n.val()&&L.geoJSON(JSON.parse(n.val()),{onEachFeature:function(e,t){i.addLayer(t),cB.map.fitBounds(i.getBounds())}})},getDataProperty:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e.data(t)||a},initaliseDisplaySelect:function(e){e.select2({ajax:{url:e.data("searchUrl"),dataType:"json",data:function(e){var t={isDisplaySpecific:-1,forSchedule:1,displayGroup:e.term,start:0,length:10,columns:[{data:"isDisplaySpecific"},{data:"displayGroup"}],order:[{column:0,dir:"asc"},{column:1,dir:"asc"}]};return null!=e.page&&(t.start=10*(e.page-1)),t},processResults:function(t,a){var n=[],i=[];$.each(t.data,(function(e,t){1===t.isDisplaySpecific?i.push({id:t.displayGroupId,text:t.displayGroup}):n.push({id:t.displayGroupId,text:t.displayGroup})}));var r=a.page||1;return r=r>1?r-1:r,{results:[{text:e.data("transGroups"),children:n},{text:e.data("transDisplay"),children:i}],pagination:{more:10*r<t.recordsTotal}}}}})},initialiseLayoutSelect:function(e){this.$layoutSelect=e,makePagedSelect(e),e.on("select2:select",(function(e){e.params.data&&cB.openLayoutForm({layoutId:e.params.data.id,daysOfWeek:"1,2,3,4,5,6,7"},campaignBuilderTrans.addLayoutFormTitle)}))},openLayoutForm:function(e,t){null===this.templateLayoutAddForm&&(this.templateLayoutAddForm=Handlebars.compile($("#campaign-builder-layout-add-form-template").html()));var a=this.templateLayoutAddForm(e),n=bootbox.dialog({title:t,message:a,size:"large",buttons:{cancel:{label:campaignBuilderTrans.cancelButton,className:"btn-white",callback:function(){XiboDialogClose()}},add:{label:campaignBuilderTrans.saveButton,className:"btn-primary save-button",callback:function(){return n.find(".XiboForm").submit(),!1}}}}).on("shown.bs.modal",(function(){var t=n.find(".XiboForm"),a=n.find('select[name="daysOfWeek[]"]');$.each(e.daysOfWeek.split(","),(function(e,t){a.find("option[value="+t+"]").attr("selected","selected")})),a.select2({width:"100%"}).val();var i=n.find('select[name="dayPartId"]');e.dayPartId&&i.data("initial-value",e.dayPartId),makePagedSelect(i),cB.initialiseMap("campaign-builder-map",n),n.find(".XiboForm").validate({submitHandler:function(e){XiboFormSubmit($(e),null,(function(){var e=t.data("existingDisplayOrder");e&&parseInt(e)>0?$.ajax({method:"delete",url:t.data("assignmentRemoveUrl")+"&displayOrder="+e,complete:function(){refreshLayoutAssignmentsTable()}}):refreshLayoutAssignmentsTable()}))},errorElement:"span",highlight:function(e){$(e).closest(".form-group").removeClass("has-success").addClass("has-error")},success:function(e){$(e).closest(".form-group").removeClass("has-error").addClass("has-success")},invalidHandler:function(e,t){$(this).closest(".modal-dialog").find(".saving").remove(),$(this).closest(".modal-dialog").find(".save-button").removeClass("disabled")}})})).on("hidden.bs.modal",(function(){cB.$layoutSelect&&cB.$layoutSelect.val(null).trigger("change")}))},initialiseLayoutAssignmentsTable:function(e){this.layoutAssignments=e.DataTable({language:dataTablesLanguage,responsive:!0,dom:dataTablesTemplate,filter:!1,searchDelay:3e3,order:[[0,"asc"]],ajax:{url:e.data("searchUrl"),dataSrc:function(e){return e&&e.data&&e.data.length>0?e.data[0].layouts:[]}},columns:[{data:"layoutId",responsivePriority:5},{data:"layout",responsivePriority:1},{data:"duration",responsivePriority:1},{data:"dayPart",responsivePriority:1},{data:"daysOfWeek",responsivePriority:3,render:function(e){if(e){var t=[];return e.split(",").forEach((function(e){t.push(campaignBuilderTrans.daysOfWeek[e]||e)})),t.join(", ")}return""}},{data:"geoFence",responsivePriority:10,render:function(e,t){return"display"!==t?!!e:'<i class="fa fa-'+(e?"check":"times")+'"></i>'}},{data:function(t,a,n,i){var r=[{id:"assignment_button_edit",text:campaignBuilderTrans.assignmentEditButton,url:"#",external:!1,class:"button-assignment-remove",dataAttributes:[{name:"row-id",value:i.row}]},{id:"assignment_button_delete",text:campaignBuilderTrans.assignmentDeleteButton,url:e.data("assignmentDeleteUrl")+"?displayOrder="+t.displayOrder}];return dataTableButtonsColumn({buttons:r},a,n,i)},orderable:!1,responsivePriority:1}]}),this.layoutAssignments.on("draw",(function(e,t){$("#"+e.target.id).find(".button-assignment-remove").on("click",(function(e){e.preventDefault();var t=$(this);return t.hasClass("assignment_button_edit")&&cB.openLayoutForm(cB.layoutAssignments.rows(t.data("rowId")).data()[0],campaignBuilderTrans.editLayoutFormTitle),!1})),XiboInitialise("#"+e.target.id)}))}},$((function(){var e=$("#campaign-builder");cB.initialise(e),cB.initaliseDisplaySelect(e.find('select[name="displayGroupIds[]"]')),cB.initialiseLayoutSelect(e.find('select[name="layoutId"]')),cB.initialiseLayoutAssignmentsTable(e.find("table#table-campaign-builder-layout-assignments"))})),window.refreshLayoutAssignmentsTable=function(){cB.layoutAssignments&&cB.layoutAssignments.ajax.reload()}}();