1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ticketsNearBy=e():(t.ntt=t.ntt||{},t.ntt.smartit=t.ntt.smartit||{},t.ntt.smartit.ticketsNearBy=e())}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"ticketNearBy",function(){return s});r(4);function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}r(1),r(3);var s=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,c(e).apply(this,arguments))}var r,n,s;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,ntt.smartit.api.ICustomModule),r=e,(n=[{key:"name",value:function(){return"ticketsNearBy"}},{key:"injectTemplates",value:function(){return{"views/ticket/profiles/incident-profile.html":[{id:"ticketsNearBy",mode:"partial",method:"addafter",type:"jquery",snippet:"<rs-nearby-tickets></rs-nearby-tickets>",selector:function(t){return t.find("rs-recommended-ka")}}],"views/ticket/profiles/draft-incident-profile.html":[{id:"ticketsNearBy",mode:"partial",method:"addafter",type:"jquery",snippet:"<rs-nearby-tickets></rs-nearby-tickets>",selector:function(t){return t.find("rs-recommended-ka")}}]}}},{key:"templates",value:function(){return[{template:"views/ticket/resource/rs-nearby-tickets.html"}]}},{key:"i18nLocales",value:function(){return{de:["i18n/ntt-resources-nearByTicket-locale_de.json"],en:["i18n/ntt-resources-nearByTicket-locale_en.json"]}}}])&&o(r.prototype,n),s&&o(r,s),e}();ntt.smartit.api.nttSmartitModules.push(new s)},function(t,e,r){"use strict";r.r(e);r(2);angular.module("resourceModule").directive("rsNearbyTickets",["nttTicketDistanceService","$rootScope","searchService","nttGenericService","objectValueMapperService","relationModel","$q","events",function(t,e,r,n,o,i,c,a){return{require:"^rs",restrict:"E",scope:{},templateUrl:"views/ticket/resource/rs-nearby-tickets.html",link:function(r,n,i,c){angular.extend(r,c);var s=r.context,u={itemLimit:4,isDataLoading:!1,watchersOn:!1,ticketFilterStatuses:["all","open","resolved","cancelled"]};function f(){var e=o.getFieldByName("standort_koordinate1_dec").value,n=o.getFieldByName("standort_koordinate2_dec").value;u.isDataLoading=!0,e&&n?t.getIncidentsByDistance(n,e,r.distanceRange,s.id,u.ticketFilterSelectedStatus).then(function(t){u.isDataLoading=!1,u.distanceServiceError=!1,r.recommendedTickets=t.incidents,u.watchersOn||(u.watchersOn=!0,r.$watchCollection("context",function(t,e){t.customFields.standort_koordinate1!==e.customFields.standort_koordinate1&&f()}))},function(t){u.isDataLoading=!1,u.distanceServiceError=!0,u.distanceServiceErrorMessage=t.detailedMessage,r.recommendedTickets=[]}):u.isDataLoading=!1}u.ticketFilterSelectedStatus=u.ticketFilterStatuses[1],r.recommendedTickets=[],r.distanceRange=.2,r.statusFilter=function(t){return"all"===u.ticketFilterSelectedStatus||("open"===u.ticketFilterSelectedStatus?_.includes(["Assigned","In Progress","Pending"],t.status):t.status.toLowerCase()===u.ticketFilterSelectedStatus||void 0)},r.$watch("state.ticketFilterSelectedStatus",function(t,e){t!=e&&f()}),r.context=s,r.state=u,f(),r.distanceChamged=function(){f()},r.$on(a.REFRESH_RESOURCE_FEED,function(){f()}),r.$on("nttevent_adress_changed",function(){f()}),r.openNearbyTickets=function(){e.$broadcast("openAddressDialogNearBy",{displayOnly:!0,showNearByTicketPanel:!0,distanceRange:r.distanceRange,selectedStatus:u.ticketFilterSelectedStatus})}}}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(e);const o=Symbol.for("SchemaOptions");function i(t){return f(t)&&t.hasOwnProperty("fn")&&t.hasOwnProperty("path")}function c(t){return l(t)}function a(t){return Array.isArray(t)&&t.every(c)}const s=(t,e)=>t.reduce((t,r)=>(y(t,r,d(e,r)),t),{});function u(t){return void 0===t}function f(t){const e=typeof t;return null!=t&&("object"===e||"function"===e)}function l(t){return"string"==typeof t||t instanceof String}function p(t){return"function"==typeof t}function d(t,e){const r=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");for(let e=0,n=r.length;e<n;++e){const n=r[e];if(!(f(t)&&n in t))return;t=t[n]}return t}function h(t,e){return t.reduce((t,r,o)=>(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),o.forEach(function(e){n(t,e,r[e])})}return t})({},t,{[r]:e[o]}),{})}function y(t,e,r,n){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if("string"==typeof e)return y(t,e.split(".").map(m),r,n);const o=e[0],i=function(t,e){if(function(t,e){return"number"==typeof e&&Array.isArray(t)||function(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)}(t,e)}(t,e))return t[e]}(t,o);return 1===e.length?(void 0!==i&&n||(t[o]=r),i):(void 0===i&&("number"==typeof e[1]?t[o]=[]:t[o]={}),y(t[o],e.slice(1),r,n))}function m(t){const e=parseInt(t);return e.toString()===t?e:t}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){b(t,e,r[e])})}return t}function b(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let v;function S(t,e){return e&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(e)&&(t[o]=e),t}!function(t){t.Root="Root",t.Property="Property",t.ActionFunction="ActionFunction",t.ActionAggregator="ActionAggregator",t.ActionString="ActionString",t.ActionSelector="ActionSelector"}(v||(v={}));class w{constructor(t){this.schemaOptions=void 0,this.root=void 0,this.schema=void 0,this.schema=t,this.schemaOptions=w.getSchemaOptions(this.schema),this.root={data:{targetPropertyPath:"",propertyName:"MorphismTreeRoot",action:null,kind:v.Root},parent:null,children:[]},t&&this.parseSchema(t)}static getSchemaOptions(t){return g({},{class:{automapping:!0},undefinedValues:{strip:!1}},t?t[o]:void 0)}parseSchema(t,e,r){var n;(l(n=t)||p(n)||i(n)||a(n))&&e?(this.add({propertyName:e,action:t},r),r=r?"".concat(r,".").concat(e):e):(e&&(this.add({propertyName:e,action:null},r),r=r?"".concat(r,".").concat(e):e),Array.isArray(t)?t.forEach((t,e)=>{this.parseSchema(t,e.toString(),r)}):f(t)&&Object.keys(t).forEach(e=>{this.parseSchema(t[e],e,r)}))}*traverseBFS(){const t=[];for(t.push(this.root);t.length>0;){let e=t.shift();if(!e)return;for(let r=0,n=e.children.length;r<n;r++)t.push(e.children[r]);e.data.kind!==v.Root&&(yield e)}}add(t,e){const r=this.getActionKind(t.action);if(!r)throw new Error("The action specified for ".concat(t.propertyName," is not supported."));const n={data:g({},t,{kind:r,targetPropertyPath:""}),parent:null,children:[]};if(n.data.preparedAction=this.getPreparedAction(n.data),e)for(const t of this.traverseBFS())t.data.targetPropertyPath===e&&(n.parent=t,n.data.targetPropertyPath="".concat(t.data.targetPropertyPath,".").concat(n.data.propertyName),t.children.push(n));else n.parent=this.root,n.data.targetPropertyPath=n.data.propertyName,this.root.children.push(n)}getActionKind(t){return c(t)?v.ActionString:p(t)?v.ActionFunction:i(t)?v.ActionSelector:a(t)?v.ActionAggregator:null===t?v.Property:void 0}getPreparedAction(t){const{propertyName:e,action:r,kind:n}=t;if(c(r))return t=>{let{object:e}=t;return d(e,r)};if(p(r))return t=>{let{object:e,items:n,objectToCompute:o}=t;return r.call(void 0,e,n,o)};if(a(r))return t=>{let{object:e}=t;return s(r,e)};if(i(r))return t=>{let n,{object:o,items:i,objectToCompute:c}=t;try{let a;Array.isArray(r.path)?a=s(r.path,o):l(r.path)&&(a=d(o,r.path)),n=r.fn.call(void 0,a,o,i,c)}catch(t){throw t.message="Unable to set target property [".concat(e,"].\n \n An error occured when applying [").concat(r.fn.name,"] on property [").concat(r.path,"]\n \n Internal error: ").concat(t.message),t}return n};if(n===v.Property)return null;throw new Error("The action specified for ".concat(e," is not supported."))}}function O(t){return(e,r,n)=>{const o=n.value;return"function"==typeof o&&(n.value=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];const i=o.apply(this,r);return function(t){if(Promise&&Promise.resolve)return Promise.resolve(t)==t;throw"Promise not supported in your environment"}(i)?Promise.resolve(i).then(e=>t(e)):t(i)}),n}}function j(t,e,r,n){const o=e.schemaOptions,i=[];for(const o of e.traverseBFS()){const{preparedAction:e,targetPropertyPath:c}=o.data;e&&i.push({targetPropertyPath:c,preparedAction:e({object:t,objectToCompute:n,items:r})})}return i.reduce((t,e)=>{const r=((t,e)=>u(e)?u(t)?void 0:t:e)(d(t,e.targetPropertyPath),e.preparedAction);return void 0===r?(o&&o.undefinedValues&&o.undefinedValues.strip?o.undefinedValues.default&&y(t,e.targetPropertyPath,o.undefinedValues.default(t,e.targetPropertyPath)):y(t,e.targetPropertyPath,r),t):(y(t,e.targetPropertyPath,r),t)},n)}function P(t,e){const r=w.getSchemaOptions(t);let n;if(e&&r.class&&r.class.automapping){const r=function(t,e){let r=Object.keys(new t),n=h(r,r);return Object.assign(n,e)}(e,t);n=new w(r)}else n=new w(t);return function(t){if(!t)return t;if(Array.isArray(t))return t.map(r=>{if(e){const o=new e;return j(r,n,t,o)}return j(r,n,t,{})});{const r=t;if(e){const t=new e;return j(r,n,[r],t)}return j(r,n,[r],{})}}}function k(t,e,r){switch(arguments.length){case 1:return P(t);case 2:return P(t)(e);case 3:if(r)return null!==e?P(t,r)(e):P(t,r);throw new Error("When using morphism(schema, items, type), type should be defined but value received is ".concat(r))}}function A(t,e){return O(P(t,e))}function x(t){return O(P(t))}function _(t,e){return O(P(t,e))}r.d(e,"morph",function(){return A}),r.d(e,"toJSObject",function(){return x}),r.d(e,"toClassObject",function(){return _}),r.d(e,"morphism",function(){return k}),r.d(e,"createSchema",function(){return S}),r.d(e,"Schema",function(){}),r.d(e,"StrictSchema",function(){}),r.d(e,"SchemaOptions",function(){}),r.d(e,"Mapper",function(){}),r.d(e,"SCHEMA_OPTIONS_SYMBOL",function(){return o});const M=new class{constructor(t){this._registry=null,this._registry=t||{cache:new Map}}register(t,e){if(!t&&!e)throw new Error("type paramater is required when you register a mapping");if(this.exists(t))throw new Error("A mapper for ".concat(t.name," has already been registered"));let r;return r=k(e||{},null,t),this._registry.cache.set(t,r),r}map(t,e){if(!this.exists(t)){const r=this.register(t);if(void 0===e)return r}return this.getMapper(t)(e)}getMapper(t){return this._registry.cache.get(t)}setMapper(t,e){if(e){if(this.exists(t)){let r=k(e,null,t);return this._registry.cache.set(t,r),r}throw new Error("The type ".concat(t.name," is not registered. Register it using `Mophism.register(").concat(t.name,", schema)`"))}throw new Error("The schema must be an Object. Found ".concat(e))}deleteMapper(t){return this._registry.cache.delete(t)}exists(t){return this._registry.cache.has(t)}get mappers(){return this._registry.cache}},E=k;E.register=(t,e)=>M.register(t,e),E.map=(t,e)=>M.map(t,e),E.getMapper=t=>M.getMapper(t),E.setMapper=(t,e)=>M.setMapper(t,e),E.deleteMapper=t=>M.deleteMapper(t),E.mappers=M.mappers;const T=E;e.default=T}])},function(t,e,r){"use strict";angular.module("resourceModule").filter("meterToKm",function(){return function(t){return t<1e3?Math.trunc(t)+" m":(t/1e3).toFixed(2)+" km"}})},function(t,e,r){var n=r(5);"string"==typeof n&&(n=[[t.i,n,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};r(7)(n,o);n.locals&&(t.exports=n.locals)},function(t,e,r){(t.exports=r(6)(!1)).push([t.i,".ntt-nearby-icon-header{top:2px;font-size:20px;color:#999}.ntt-rs-group__filter{top:-20px;display:inline-block;float:right;padding-left:10px}",""])},function(t,e,r){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=function(t,e){var r=t[1]||"",n=t[3];if(!n)return r;if(e&&"function"==typeof btoa){var o=(c=n,a=btoa(unescape(encodeURIComponent(JSON.stringify(c)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(s," */")),i=n.sources.map(function(t){return"/*# sourceURL=".concat(n.sourceRoot).concat(t," */")});return[r].concat(i).concat([o]).join("\n")}var c,a,s;return[r].join("\n")}(e,t);return e[2]?"@media ".concat(e[2],"{").concat(r,"}"):r}).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},o=0;o<this.length;o++){var i=this[o][0];null!=i&&(n[i]=!0)}for(var c=0;c<t.length;c++){var a=t[c];null!=a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="(".concat(a[2],") and (").concat(r,")")),e.push(a))}},e}},function(t,e,r){var n,o,i={},c=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=n.apply(this,arguments)),o}),a=function(t){var e={};return function(t,r){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,r);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),s=null,u=0,f=[],l=r(8);function p(t,e){for(var r=0;r<t.length;r++){var n=t[r],o=i[n.id];if(o){o.refs++;for(var c=0;c<o.parts.length;c++)o.parts[c](n.parts[c]);for(;c<n.parts.length;c++)o.parts.push(b(n.parts[c],e))}else{var a=[];for(c=0;c<n.parts.length;c++)a.push(b(n.parts[c],e));i[n.id]={id:n.id,refs:1,parts:a}}}}function d(t,e){for(var r=[],n={},o=0;o<t.length;o++){var i=t[o],c=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};n[c]?n[c].parts.push(a):r.push(n[c]={id:c,parts:[a]})}return r}function h(t,e){var r=a(t.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=f[f.length-1];if("top"===t.insertAt)n?n.nextSibling?r.insertBefore(e,n.nextSibling):r.appendChild(e):r.insertBefore(e,r.firstChild),f.push(e);else if("bottom"===t.insertAt)r.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=a(t.insertAt.before,r);r.insertBefore(e,o)}}function y(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=f.indexOf(t);e>=0&&f.splice(e,1)}function m(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var n=function(){0;return r.nc}();n&&(t.attrs.nonce=n)}return g(e,t.attrs),h(t,e),e}function g(t,e){Object.keys(e).forEach(function(r){t.setAttribute(r,e[r])})}function b(t,e){var r,n,o,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var c=u++;r=s||(s=m(e)),n=w.bind(null,r,c,!1),o=w.bind(null,r,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),h(t,e),e}(e),n=function(t,e,r){var n=r.css,o=r.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(n=l(n));o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var c=new Blob([n],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(c),a&&URL.revokeObjectURL(a)}.bind(null,r,e),o=function(){y(r),r.href&&URL.revokeObjectURL(r.href)}):(r=m(e),n=function(t,e){var r=e.css,n=e.media;n&&t.setAttribute("media",n);if(t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}.bind(null,r),o=function(){y(r)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=c()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var r=d(t,e);return p(r,e),function(t){for(var n=[],o=0;o<r.length;o++){var c=r[o];(a=i[c.id]).refs--,n.push(a)}t&&p(d(t,e),e);for(o=0;o<n.length;o++){var a;if(0===(a=n[o]).refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete i[a.id]}}}};var v,S=(v=[],function(t,e){return v[t]=e,v.filter(Boolean).join("\n")});function w(t,e,r,n){var o=r?"":n.css;if(t.styleSheet)t.styleSheet.cssText=S(e,o);else{var i=document.createTextNode(o),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(i,c[e]):t.appendChild(i)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var r=e.protocol+"//"+e.host,n=r+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?r+i:n+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}}])}); |