sheet=_this$options2.sheet;// It is a rules container like for e.g. ConditionalRule.
if(rule.rulesinstanceofRuleList){
rule.rules.update(data,options);
return;
}
varstyle=rule.style;
plugins.onUpdate(data,rule,sheet,options);// We rely on a new `style` ref in case it was mutated during onUpdate hook.
if(options.process&&style&&style!==rule.style){
// We need to run the plugins in case new `style` relies on syntax plugins.
plugins.onProcessStyle(rule.style,rule,sheet);// Update and add props.
for(varpropinrule.style){
varnextValue=rule.style[prop];
varprevValue=style[prop];// We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.
// We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.
if(nextValue!==prevValue){
rule.prop(prop,nextValue,forceUpdateOptions);
}
}// Remove props.
for(var_propinstyle){
var_nextValue=rule.style[_prop];
var_prevValue=style[_prop];// We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.
// We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.
if(parentNode)parentNode.insertBefore(style,insertionPointElement.nextSibling);elseprocess.env.NODE_ENV!=="production"?warning(false,'[JSS] Insertion point is not in the DOM.'):void0;
return;
}
getHead().appendChild(style);
}
/**
* Read jss nonce setting from the page if the user has set it.
if(parentNode)parentNode.removeChild(this.element);// In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.
// Though IE will keep them and we need a consistent behavior.